0% found this document useful (0 votes)
9 views19 pages

A Multi Task Learning Based Framework For Global Maritime - 2022 - Maritime Tran

Research paper on Maritime Transport

Uploaded by

Vineet Bharti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views19 pages

A Multi Task Learning Based Framework For Global Maritime - 2022 - Maritime Tran

Research paper on Maritime Transport

Uploaded by

Vineet Bharti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Maritime Transport Research 3 (2022) 100072

Contents lists available at ScienceDirect

Maritime Transport Research


journal homepage: www.elsevier.com/locate/martra

A multi-task learning-based framework for global maritime


trajectory and destination prediction with AIS data
Wells Wang a ,∗, Junchi Bin a , Amirhossein Zaji a , Richard Halldearn b ,
Fabien Guillaume c , Eric Li d , Zheng Liu a ,∗
a
School of Engineering, University of British Columbia Okanagan, Kelowna, V1V 1V7, BC, Canada
b
Spire Maritime, Luxembourg, 2763, Luxembourg
c
Navarik, Vancouver, V5T 1B1, BC, Canada
d Faculty of Management, University of British Columbia Okanagan, Kelowna, V1V 1V7, BC, Canada

ARTICLE INFO ABSTRACT

Keywords: Automatic Identification System (AIS) was initially developed for tracking ships and avoiding
Automatic Identification System collisions. As numerous small satellites were launched in recent years, millions of AIS messages
Vessel destination prediction are captured by these satellite AIS providers every day. The massive amount of data allow
Vessel trajectory prediction
shipping firms and port operators to better predict vessels’ movement. In this study, a
Vessel origin–destination analysis
computational framework is developed to predict future trajectories and destinations of vessels
by applying deep learning to the satellite AIS messages containing self-reporting positioning
data. We employed deep learning approaches for large-scale maritime prediction and identifies
the most suitable deep neural networks for this specific application. Three prediction models,
Convolutional Neural Networks (CNN), Dense Neural Networks (DNN), and Long Short-Term
Memory (LSTM) have been tested in the framework. A multi-task learning architecture is
implemented based on test results. Through sharing parameters while training, this architecture
enables long-term destination predictions by balancing short-term trajectory predictions. The
framework is validated globally with the experiments covering five large-scale sea areas. The
experimental results demonstrate that the LSTM model with an average accuracy percentage
of 85.1% outperforms the CNN and DNN with accuracy percentages of 68.3% and 78.2%
respectively. The LSTM model with multi-task architecture can achieve an accuracy of 87.0%.
With the proposed computational framework, AIS data can be utilized for maritime predictions,
supporting more complex marine applications and covering more expansive geographic areas.

1. Introduction

Safe and efficient maritime transportation planning depends greatly on understanding vessel travel patterns and deriving vessels’
future positions. Predicting the next positions of autonomous vessels help collision avoidance (Hexeberg et al., 2017). Vessel voyage’s
static information such as destination port, however, is manually set therefore is unreliable in some extent (Baldauf et al., 2008).
Hence, stakeholders such as port authorities and vessel operators often faced challenges to predict a vessel’s future position and
destination. Automatic Identification System (AIS) provides a vast amount of data containing self-reporting positioning messages of
vessels (Res. A.1106, 29). With proper handling, these AIS data can be utilized to achieve the endeavor to enhance maritime safety
and efficiency by inferring vessels’ future positions.

∗ Corresponding authors.
E-mail addresses: [email protected] (W. Wang), [email protected] (J. Bin), [email protected] (A. Zaji), [email protected] (Z. Liu).

https://doi.org/10.1016/j.martra.2022.100072
Received 10 May 2022; Received in revised form 22 August 2022; Accepted 7 September 2022
Available online 28 September 2022
2666-822X/© 2022 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license
(http://creativecommons.org/licenses/by-nc-nd/4.0/).
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Fig. 1. Illustration of the research objectives.

Beyond the original endeavor of monitoring vessel positions, AIS data has transformed into a crucial source for the stakeholders
in the maritime industry, including diverse sub-sectors such as supply chain, finance, and logistics. As a conservative and
uncomputerized industry, many maritime segments were operating through complex manual process, which cost a lot of time
and money. Recently, as service providers in the maritime industries offer data solutions, firms in supply chain and logistics can
digitalize their applications. Predictive analytic and deep learning models can also be derived from historical AIS data to forecast
future positions of the vessels, giving ship operators a thorough sense of navigation, and leveraging the power of data to guide
decision making (e.g. commodities analysis Næss, 2018).
AIS data was originally envisioned as a collision avoidance system to ensure waterways safety. Traditional AIS is only available
within the terrestrial area. However, the use of satellite to capture AIS brought the coverage of data to a global basis. This
revolutionizes what we know about the vessels in the middle of the ocean. Hence, progressing beyond its original usage, satellite
AIS data plays a big role in accelerating the digitization of global maritime trade, maritime cargo inspection, and supply chain
management. Modeling within terrestrial area may meet the needs of predicting vessel future trajectory to avoid collisions. However,
from a supply chain perspective, inspections of maritime cargo happen for on the way vessels all around the globe. The area of
interest would sometimes go beyond the terrestrial area. In this case, predictions on an ocean level, where positions of vessels can
range from one port to another (trip-based), is required from the maritime stakeholders. In terms of ocean-level trip-based maritime
prediction, multiple combinations of ports should be considered when vessel trajectory were extracted from raw AIS data for model
training. When predicting targets with this multidimensional nature, projection may be subject to non-linear properties (Lecun et al.,
2015). Deep learning is a proper way to model such features with the properties.
AIS data is currently being adopted beyond its original use, given the progressive increase of satellite-based receiver net-
works (Arguedas et al., 2014). With the expansion of AIS data received, numerous maritime transportation researches apply machine
learning and deep learning to vessel trajectory prediction (Liu et al., 2019; Tang et al., 2019; Li et al., 2019) and vessel destination
prediction (Pallotta et al., 2013; Nguyen et al., 2018; Lin et al., 2018). These researches investigated vessel movement prediction
methods on numerous ocean divisions that are smaller in scale. However, while short-term route estimation is attainable, medium-
term and longer-term estimation are more crucial given the limited maneuverability of some types of vessels (e.g., container vessels
and bulk carriers) (Tu et al., 2018). This requires larger scales of ocean regions to be covered when the data is prepared. Moreover,
deep learning enables the automated formation of good representations from data, which gets us closer to the raw data without
the cost and need of human expert involvement. Nonetheless, raw AIS data requires certain processing before it can be feed
into a learning model. Treating raw AIS data as trajectories of vessels in the maritime sector, trajectory preprocessing techniques
(i.e. noise filtering Zhang et al., 2018, stay point detection Zheng, 2015, and trajectory segmentation Gaonkar et al., 2013) can be
followed, modified, and aggregated on global-based maritime trajectories. Finally, the prediction of vessel trajectory and destination
exist relations since they are both on the vessel’s future path. While single-task prediction (predicting trajectory and destination
separately) may lack efficiency and create intense burden of computational resources, deep integrative multi-task prediction may
be considered. However, as far as we know from the literature, there has not been a study making a model learn to predict both
targets (vessel trajectory and vessel destination) at once, leveraging the relationship between them while lowering the loss when
training, will benefit the model with higher performance.
To bridge these research gaps, this study presented a framework for vessel trajectory and destination prediction utilizing raw
AIS positioning data to construct deep learning models. The objective of the research is illustrated in Fig. 1. The framework aims
to fill the gaps by providing an automated process that turns raw AIS data into trainable indices (vessel historical trip trajectories),
tailored for deep learning models. With the scalability of deep learning models, larger scales of ocean regions can be covered globally.
We took the step further by investigating several deep neural networks over regions worldwide and compared their performances.
Lastly, with the intention that the model can learn a more general representation, we included a multi-task learning (Ruder, 2017)
architecture in the framework. The architecture enables the model to consider both the context of trajectory and destination port
while training.

2
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Predicting future trajectories of vessels benefits maritime transportation participants in terms of maritime safety and traffic
management. On the other hand, the vessel voyage’s static information, destination port, is manually set and unreliable to a certain
extent (Baldauf et al., 2008). Hence, the problem exists for stakeholders such as port authorities and vessel operators to predict a
vessel’s destination. For the ever-increasing degree of automation in maritime logistics that large amounts of AIS data can be applied,
a framework that can be generalized for deep learning techniques can get us closer to the raw data and deal with prediction directly.
From the big data perspective, the efficiency of prediction is as equally important as accuracy. In this situation, an end-to-end model
that can predict the two tasks at once would be more computational cost-effective than predicting them one by one. To provide
practitioners a way to utilize AIS data directly, predict vessel trajectory in advance to manage traffic, gain information on vessel
destination, and ease the computation cost, this paper ought to investigate the prediction of vessels’ future positions, including
trajectories and destinations, utilizing deep learning models.
In summary, this study provides a road map utilizing AIS data and a novel learning approach for vessel trajectory and destination
prediction. This enables the prediction of reliable ship movement in advance for maritime traffic management. Furthermore, the
study enables stakeholders to respond to ocean traffic efficiently through the proposed end-to-end deep learning-based method.
The remainder of the paper is organized as follows. Section 2 reviews vessel trajectory and destination prediction with learning
approaches. Section 3 presents the general automation process to prepare AIS data for training and the trajectory and destination
prediction methodologies in the multi-task learning architectures. Section 4 compares and discusses the experiment results for vessel
trajectory and destination prediction over different ocean regions. Section 5 is the conclusion of the study.

2. Related work: Trajectory and destination prediction

AIS was made initially for collision avoidance. However, it has become the source for many researchers and stakeholders to
understand more about marine transportation patterns and further predicts future maritime activities (Tu et al., 2018). In recent
years, with the rise of computational power and the amount of data being collected, machine learning and deep learning have
transformed data in many domains. In terms of AIS data, this section reviews the learning methods for vessel trajectory and
destination prediction that has been done in previous researches and identifies the unexplored domains and potential opportunities
for this research area.

2.1. Maritime trajectory prediction

Recent researches on vessel trajectory prediction with learning models have succeeded in capturing patterns and long-term
dependencies. Liu et al. (2019) proposed a Support Vector Regression (SVR) model optimized by Adaptive Chaos Differential
Evolution (ACDE) algorithm for its suitability on small sample training. The results show that the model can be trained with a
single vessel and predict its ship trajectory with low losses over the Tianjin port. However, as stated in the literature, the prediction
error becomes large if the target trajectory pattern is different (e.g., trajectories of different vessels, destination ports, etc.). Also,
by training historical trajectories near the Tianjin port, Tang et al. (2019) presented an LSTM model that can predict the trajectory
of the next 10 mins for ships with different patterns. However, the model failed to predict the trajectory for specific ships due to
their unique patterns.
Li et al. (2019) clustered vessel trajectory patterns and modeled these motion patterns via LSTM networks for predictions up
to 15 min. Training trajectories within the South Channel of the Yangtze River Estuary, the results show the capability of LSTM
networks in distinguishing vessel patterns for predictions. Forti et al. (2020) proposed a sequence to sequence model with encoder–
decoder LSTM architecture to capture long-term dependencies for AIS trajectories from two ports (Piombino to Portoferraio).
The LSTM-based network in the experiment shows improved performance at the vessels’ turning waypoints. Chen et al. (2020)
combined the Mixture Density Network (MDN) and LSTM to learn long-term contextual information from the historical trajectory.
The experiment is done with incomplete trajectory traveling towards the port of Virginia, predicting the future path of the vessel
for up to an hour. Valsamis et al. (2017) explored machine learning techniques and Multi-Layer Perceptron (MLP) for trajectory
prediction tasks with ship trajectories over the Aegean Sea. The work demonstrated the possibility of modeling multiple vessel routes
in a single model and claimed the generalization of trajectory prediction with machine learning approaches.
These researches focused on fitting a learning model to predict vessel trajectories pertain to regions with smaller scales,
i.e., trajectories in a port, between 2 ports, and within a small ocean division. In this case, the model’s capability of predicting
trajectories that travel beyond the regions remains unknown. Hence, investigations of utilizing deep learning models for vessel route
estimation on ocean-levels, where more diverse ship paths and travel patterns are involved, remains unexplored. Moreover, long-
term trajectory prediction is more crucial in some circumstances, e.g., prevent collisions for certain types of vessels with restricted
maneuverability, port arrangements, and traffic route guidance. This also requires more general models trained with historical
trajectory data covering regions with larger scales.
In this research, we ought to investigate how deep learning models perform in predicting vessel trajectories when a more complex
scenario is introduced, where the scale of the regions is expanded, and more ports are involved. In the meantime, we also would
like to investigate the generalization of deep learning models in different ocean divisions globally.

3
W. Wang et al. Maritime Transport Research 3 (2022) 100072

2.2. Maritime destination prediction

Predicting maritime destinations with AIS data is much more complex than purely predicting trajectories since most AIS data that
can be acquired is lacking information of vessels’ port information. Thus raw AIS data requires specific preprocessing and feature
extraction procedures, especially for neural network-based methods.
In terms of clustering-based approach, Pallotta et al. (2013) is a classic research utilizing AIS data for vessel destination
prediction. The proposed traffic route anomaly detection (TREAD) method in the research uses route clustering techniques to
extract maritime movement patterns within any predefined bounding box. The route classification method affects vessel destination
prediction within certain bounding box limits such as the Strait of Gibraltar. However, as the regions of interest expand in the Indian
Ocean, the lack of constraint and density would lower the percentage of traffic that can be clustered. Zhang et al. (2020) proposed
a random forest-based similarity measurement method for a general vessel destination prediction. The research established a global
prediction for vessel destination, where the predictive boundary is not restricted to a specific region. However, the model can only
predict with around 70 percent accuracy, which is considered a limit to this research.
As for neural network-based approaches, Nguyen et al. (2018) proposed a sequence-to-sequence model base on LSTM for vessel
destination predictions. The model maps vessel trajectories to sequence of spatial grids’ within the Mediterranean Sea as the regions
that the given AIS data falls in. Inspired by recent success in natural language processing techniques, the research discretized
the vessels’ coordinates into spatial grids to predict their arrival ports. With the same region of interests among 40 ports in the
Mediterranean Sea, Lin et al. (2018) used neural network classifiers in prediction of arrival ports. The AIS data in the neural
networks based researches stated above came from the DEBS challenge of the Hobbit project (Gulisano et al., 2018), where the
port information is given, and the data sets are preprocessed as different trips. However, in most cases, the port information is
not given in the AIS messages. On top of that, historical trajectories were used purely as inputs instead of as an auxiliary task for
destination prediction in these researches. Whether considering the loss of trajectory can improve accuracy in predicting vessel
destination can be further explored.
In the above literature, contributions of predicting maritime trajectory and maritime destination have been reviewed. As seen
above, through learning patterns of historical trips, the future paths of the vessels can be predicted. However, the concept of viewing
them in a holistic framework is yet to be brought up. In a sense, the prediction of vessel trajectory and destination are related since
the vessel would eventually get to its destination passing through the future trajectory. Vessel movements in a period of time can be
viewed as a combination of different trips between two ports (Fig. 6). Treating the trajectories as trip segments in a machine learning
point of view, predicting vessel future trajectory and its destination port holistically can be viewed as an inductive transfer (Ruder,
2017), which can help improve a model by introducing an inductive bias, which causes a model to prefer some hypotheses over
others. In this case, the relationship may cause the model to predict future trajectory with a longer-term view (destination prediction)
or predict vessel destination with regards to hypotheses that explains trajectory movements (trajectory prediction). Moreover, as the
model finds representation that captures both tasks, the potentials for the model to generalize may increase (Baxter, 1997). Thus,
this relationship can be further leveraged by adopting multi-task learning.
Intuitively, the motivation behind multi-task learning is inspired by learning of human (Caruana, 1993). When learning new
tasks, the knowledge that a person acquired by learning related tasks are often applied, such as applying the knowledge of running
when playing tennis. To understand whether making the model prefer hypotheses that explain more than one task (learning vessel
trajectory prediction and vessel destination prediction together) can ensure better generalization in maritime prediction, this research
adopted multi-task learning in the framework.
This research visits the limitations and gaps mentioned in the above literature by proposing a framework for vessel trajectory
and destination prediction. The first part of the framework provides a procedure to extract information from raw AIS data for deep
learning. The second part of the framework applies multi-task learning in the prediction of vessel trajectory and destination.

3. Multi-task learning-based maritime prediction framework

The overall architecture of the proposed multitask learning framework is shown in Fig. 2. The framework takes maritime data as
inputs, analyze and generate trip data for each vessels in the knowledge extraction process, and outputs vessels’ future trajectories
and destinations in the prediction process. With AIS data and World Port Index(WPI) data (National Geospatial-Intelligence Agency,
2019), we were able to extract knowledge of vessel trajectories segmented by trips regarding several regions of interest. The extracted
trajectories can then be the inputs for predicting ships’ future trajectories and destinations. By utilizing the framework, one can
conduct prediction on vessels’ future paths within their areas of interest.

3.1. Extracting knowledge from AIS data

Since the early 2000s, AIS data have become a major source for tracking marine traffic for safety concerns. In this section,
we introduced the background of AIS data and WPI (World Port Index) data, the procedures of preprocessing them into cleaned
trajectories, the algorithm that recognized start and end port for vessels, the extraction method of vessel trajectories segmented
by trips, and the filtering method that can be implemented in this framework for regions of interests. Finally, with the procedures
above, the AIS data can be turned into training inputs for the prediction model in the next subsection.

4
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Fig. 2. The overall architecture of the proposed framework. The details of the maritime data and knowledge extraction approaches are presented in Section 3.1.
The details of maritime predictions and the architecture of the multi-task learning model are presented in Section 3.2.

Table 1
Variable descriptions of AIS data.
Parameter Description
User ID Unique identifier such as MMSI number.
Longitude Longitude in 1/10000 min (±180◦ , East = positive(as per 2’s complement),
West = negative (as per 2’s complement).)
Latitude Latitude in 1/10000 min (±90◦ , North = positive(as per 2’s complement),
South = negative (as per 2’s complement).)
Time stamp UTC second when the report was generated by the electronic position
system (EPFS).
SOG Speed over ground in 1/10 knot steps (0-102.2 knots)

Fig. 3. The flowchart of the preprocessing procedures.

3.1.1. AIS and WPI data


In terms of maritime safety and avoiding collision, equipping AIS devices was made obligatory by the International Convention
for the Safety of Life at Sea, IMO for most ships (Res. A.1106, 29). Since the AIS messages transmit through non-secure channels,
they are widely adopted by vessel traffic services (Iphar et al., 2015). With the nature of monitoring marine traffic, AIS data can also
be used in the perspective of maritime traffic researches, such as Zhang et al. (2016). In this study, we focus on extracting vessel
voyages for future paths and destination prediction with AIS data. Hence, among the 27 types of AIS messages, the position type
of AIS data was adopted as the variable description shown in Table 1. The original parameter descriptions of type 1 AIS messages
can be found in Rec. ITU-R M.1371-5 (2014).
Since the AIS data are just positions for different ships, port information is needed to extract voyages. Hence WPI data is adopted
for reference of port positions (National Geospatial-Intelligence Agency, 2019). Port name, latitude, and longitude of ports is the
primary concern in this research. Since 3 months time span could reflect vessel patterns for a season, in this paper, AIS data within
the three months time span between Oct.1, 2018 and Dec.31, 2018 are adopted.

3.1.2. Preprocessing
Preprocessing procedures specifically tailored for the AIS trajectory are being introduced in this study. General trajectory
preprocessing methods include noise filtering, stay point detection, and trajectory compression (Zheng, 2015). However, AIS data
requires further cleaning regarding the validity of AIS trajectories and the spatial context within trajectories (Zhao et al., 2018).
Considering both the nature of AIS messages and trajectories, we show the flowchart of preprocessing procedures for the AIS
trajectory in Fig. 3.
The preprocessing procedures starts with extracting data with MMSI number, which is the form of vessel identity in AIS messages,
to different trajectories. Considering the completeness of AIS tracks, the AIS validity filtering exclude situations where 2 or more

5
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Table 2
Comparisons between two types of vessel IDs.
ID type AIS type Reassign possibility
MMSI Position, Static Yes
IMO Static No

vessels share the same MMSI number using IMO as a cross reference. The comparisons between the two types of IDs are shown
in Table 2. Next, in terms of whether the spatial index within trajectories are logical, we conduct the noise filtering method. As
the scale of the research is universal, the sampling rate of the trajectories are considered high. Hence, median filter is adopted
as a suitable measure for the process to filter out unreasonable positions in the trajectories. Finally, taking the idea of trajectory
compression in Zheng (2015), trajectories are resampled into hourly bases as a sliding window based algorithm of compression,
which reduced the computational power and set off the data for further analysis. The algorithm of the preprocessing procedures is
presented in Algorithm 1.
Algorithm 1: Preprocessing Procedures
Input: AIS data 𝑋 = [𝑥1 , 𝑥2 , ..., 𝑥𝑛 ],
MMSI in AIS data 𝑀𝑥 = [𝑚𝑥1 , 𝑚𝑥2 , ..., 𝑚𝑥𝑛 ],
IMO data 𝑂 = [𝑜1 , 𝑜2 , ..., 𝑜𝑘 ],
MMSI in IMO data 𝑀𝑜 = [𝑚𝑜1 , 𝑚𝑜2 , ..., 𝑚𝑜𝑘 ]
Output: Preprocessed Trajectories 𝑇
grouped = group 𝑋 by 𝑀𝑥 ;
mmsi_list = grouped.keys;
𝑁𝑙𝑖𝑠𝑡 = len(mmsi_list);
FC = frequency count for 𝑀𝑜 in 𝑂;
new𝑂 = O where FC < 2;
foreach 𝑖 ∈ [0, 𝑁𝑙𝑖𝑠𝑡 − 1] do
keys = mmsi_list(i);
𝑇𝑖 = grouped.get_group(keys);
𝑁𝑡𝑟𝑎𝑗 = len(𝑇𝑖 );
while mmsi𝑖 exists in new𝑂 do
foreach 𝑗 ∈ [0, 𝑁𝑡𝑟𝑎𝑗 − 1] do
obs𝑗 = observation j in list of 𝑇𝑖 ;
lat𝑗 = latitude of obs𝑗 ;
lon𝑗 = longitude of obs𝑗 ;
while −90 > lat𝑗 > 90 or
−180 > lon𝑗 > 180 do
remove obs𝑗 from list of 𝑇𝑖
end
lat𝑗 = median(rolling(lat𝑗 ));
lon𝑗 = median(rolling(lon𝑗 ));
end
resample 𝑇𝑖 by timestamp (interval=hour);
save 𝑇𝑖
end
end

3.1.3. Origin destination recognition


Obtaining origin–destination (OD) matrices has been a common way of dealing with spatiotemporal data in different types of
trajectories such as vehicle and human mobility (Liu et al., 2019). Spiliopoulos et al. (2018) presented a similar method with the
port calls data since the AIS messages do not provide trustworthy information of the ports. In this study, we conducted a port-based
OD recognition with the combination of AIS and WPI data. With a zone created around each port for detection, stationary AIS
trajectory points with the zones are labeled as ported stay points. Then, a port-based OD matrices can be generated through the
recognition process. Finally, OD parameters as shown in Table 3 for 4802 vessel trips were obtained. The distribution of duration
and distance of the voyages are shown in Fig. 4. Moreover, referencing the coordinates back to WPI data, the port names and the
country of start and end point can also be added as the metadata for each voyages.
Knowing the information of the ports is essential to the process because it stands for the departure and destination points, which
is part of our input and output in the maritime prediction. The port labeling process aims to label the positions where the vessels
remain stationary at port area. As mentioned in Section 3.1.1, the WPI data provides various information about ports around the
globe. By combining the knowledge of the AIS and the WPI data, port labeling (as shown in Algorithm 2) is done in the following
steps:

6
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Fig. 4. The distribution of distance and duration of trips collected in the OD data.

Algorithm 2: Port Labeling


Input: preprocessed trajectory 𝑇 = [𝑥1 , 𝑥2 , ..., 𝑥𝑛 ],
coordinates of WPI data 𝑃 = [𝑝1 , 𝑝2 , ..., 𝑝𝑛 ]
Output: Trajectories with port labels 𝑇𝑝𝑜𝑟𝑡𝑠
𝑁𝑝𝑜𝑟𝑡𝑠 = len(𝑊 );
𝑁𝑡𝑟𝑎𝑗 = len(𝑇 );
# Stay point detection
𝐷𝐵 = define DBSCAN with parameters epsilon=4 miles and minimum samples=4 ;
foreach 𝑖 ∈ [0, 𝑁𝑡𝑟𝑎𝑗 − 1] do
𝑁𝑐𝑜𝑜𝑟𝑑𝑠 = len(𝑖) coords = empty list;
foreach 𝑗 ∈ [0, 𝑁𝑐𝑜𝑜𝑟𝑑𝑠 − 1 do
lat𝑗 = latitude of 𝑗;
lon𝑗 = longitude of 𝑗;
coords = append (lat𝑗 , lon𝑗 ) to coords
end
stay = fit 𝐷𝐵 to coords # stay points will be labeled as True else False
add stay as a new variable to T𝑖 ;
save T𝑖 # save trajectory with labels added
end
# Generate polygons around port for detection
ports_poly = empty list;
foreach 𝑖 ∈ [0, 𝑁𝑝𝑜𝑟𝑡𝑠 − 1] do
lat𝑖 = latitude of 𝑖;
lon𝑖 = longitude of 𝑖;
buffer𝑖 = buffer(lat𝑖 , lon𝑖 ) for 3.5 miles;
ports_poly = append buffer𝑖 to ports_poly
end
# Port detection
foreach 𝑖 ∈ [0, 𝑁𝑡𝑟𝑎𝑗 − 1] do
𝑁𝑐𝑜𝑜𝑟𝑑𝑠 = len(𝑖);
ported = empty list;
foreach 𝑗 ∈ [0, 𝑁𝑐𝑜𝑜𝑟𝑑𝑠 − 1 do
lat𝑗 = latitude of 𝑗;
lon𝑗 = longitude of 𝑗;
if stay𝑗 is True and (lat𝑗 ,lon𝑗 ) within ports_poly then
ported = append True to ported
else
ported = append False to ported
end
add ported as a new variable to T𝑖 ;
save T𝑖
end
end

7
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Table 3
Variable descriptions of OD data.
Parameters Descriptions
MMSI Unique identifiers for vessels
STime The start time of the trip
SLng The longitude of vessels’ departure positions
SLat The latitude of vessels’ departure positions
ETime The end time of the trip
ELng The longitude of vessels’ destination positions
ELat The latitude of vessels’ destination positions

Fig. 5. The visualization of port polygons.

1. Detecting ‘‘stay points’’: Detecting stay points in a trajectory helps narrow down the target so that positions where vessels
are ported can be further located. To detect stay points, clustering method is adopted. Positions that remains stationary but
shifting around is detected as a clustered stay point, then positions that does not belong to the cluster is recognized as moving
vessels. The implementation is also done with the DBSCAN (Schubert et al., 2017) clustering method given the radius of 4
miles and minimum samples of 4.
2. Generate port polygons: In order to detect whether a vessel’s stay point is at port, we need to create and area representing
ports (docks) so that we can know if the vessel stay point is within that area or not. The process is done by generating circles
around all ports in the WPI data, and take the union of circles that intersects with each other. The implementation is done
with the python geopandas package (Team GeoPandas, 2013-2019). Fig. 5 visualizes the generated port polygons.
3. Label port positions: With the port labeling method, we can determine whether a stay point is a port. This process cross
check port polygons and the positions of the stay points, then determine whether it should be consider as a port. Next, for
the stay points detected in the previous steps, this process detect if each points are within the generated port polygons. The
stay points within the port polygons would be labeled as ‘‘ported’’.

Fig. 6 visualizes the port labeling results, where the red points are vessel positions that are labeled as ‘‘ported’’. With the
port labeled trajectory data, the further OD data generation process could then proceed. This would establish a data of the origin
(departure port) and the destination (arrival port) as extracted knowledge from the AIS data.

3.1.4. Trip extraction


The trip extraction process queries back to the preprocessed AIS trajectories using vessel voyages information in the OD data.
In the process, the AIS points between the start and end port in the OD data were extracted as trajectory segments. The algorithm
of the trip extraction procedures is presented in Algorithm 3.
The extracted trajectory segments are defined as trip trajectories, which are then feed into the model training process for the
prediction in the framework. The trips trajectories extracted within the 3 months time span between Oct.1, 2018 and Dec.31, 2018
are stored in separate csv files. Then, by pushing the coordinates and time of each trip trajectories into geojson format, the trip
trajectories could be visualized on a world map using kepler.gl (Urban Computing Foundation, 2018), a geospatial visualization
framework open sourced by Uber. Fig. 7 visualizes the trips extraction results generated from the AIS data.

3.1.5. Region filters


Defining regions of interest brings focus to areas where the research lies in and reduces redundant data. The region filter process
is designed to filter the extracted trip trajectories into different sea regions. Næss (2018) divided the world into polygons and
conducted a vessel capacity count within each polygons using ray casting algorithms (Sutherland et al., 1974). Since the framework
in this study aims to predict maritime future paths on a global bases, we adopted the method and implemented the framework

8
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Fig. 6. Visualizing port labeling results for a single vessel trajectory.

Algorithm 3: Trip Extraction


Input: OD data D = [D1 , D2 , ..., D𝑛 ],
AIS trajectories A = [A1 , A2 , ..., A𝑚 ]
Output: Vessel Trip Data
foreach 𝑖 ∈ [1, 𝑛] do
j = index of A where D𝑖 {mmsi}=A𝑖 {mmsi};
Read A𝑗 ;
stime = D𝑖 {STime};
etime = D𝑖 {STime};
srow = index of A𝑗 where A𝑗 {timestamp}=stime;
erow = index of A𝑗 where A𝑗 {timestamp}=etime;
trip𝑖 = A𝑗 [srow:erow];
Save trip𝑖 ;
end

Fig. 7. Visualization of trips extracted from the AIS data.

9
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Fig. 8. A demo of trip trajectories after region filter in the NWE region.

in different sea regions around the globe. The extracted trip trajectories were categorized into the following regions for further
predictions(the model training process): the Atl(Atlantic), EstP(East Pacific), NWE(North West Europe), Med(Mediterranean), and
ER (Arabian Gulf, Indian Ocean, and Far East). Fig. 8 shows a demo of trip trajectories within the NWE region after the region filter
process. For the later training process done in this study, we focus our interest separately on the trip trajectories within these five
predefined regions.

3.2. Trajectory and destination prediction

In this subsection we focus on constructing predictive models with the data generated from the knowledge extraction process.
With the trip trajectories generated in the previous phase, the deep learning models can then be constructed. To enable neural
networks to predict the two targets(future position and destination), the sliding window technique can be applied for turning time
series data (trip trajectories) into a supervised structure (Vafaeipour et al., 2014). For each timestamp 𝑡 in a trip trajectory, the input
trajectory of the model is 𝑥(𝑡−𝑚)
𝜆,𝜙
, … , 𝑥(𝑡)
𝜆,𝜙
, where 𝑚 is the window, 𝑥𝜆,𝜙 is the vessel’s position, 𝜆 and 𝜙 is the latitude and longitude
of the vessel. For each input trajectory, we have two targets:

• Trajectory target 𝑦(𝑡+1)


𝜆,𝜙
: The position of the vessel at next timestamp during the trip.
• Destination target 𝑦𝑑 : The destination information from the original trip trajectory.

Intuitively, we can view each pair of input trajectory and its targets as an observation of our supervised input data set. Hence,
we can denote the input data of the model as:
𝑁
 = (𝑥(𝑖) , 𝑦(𝑖) , 𝑦(𝑖) )
𝜆,𝜙 𝜆,𝜙 𝑑
, (1)
𝑖=1

where 𝑁 is the total observations in the data set, 𝑋𝜆,𝜙 ∈ R𝑚×2


is the input trajectory tensor, 𝑌𝜆,𝜙 ∈ R2
is the vessel position of the
next timestamp (𝜆 and 𝜙 is the latitude and longitude of the vessel, respectively), and 𝑌𝑑 ∈ R𝐾 is the destination corresponding to
each trip as 𝐾 is the number of ports in .
After the trajectories has been transformed into supervised data, the format of the deep learning model input is three dimensional
(samples, time steps, features). In this research, the samples indicates the number of observations after trajectories being transformed
into supervised data, time steps refers to the window size of 12 h, and the features are latitude and longitude, respectively. The
format of the first output is (samples, features) as the model aims to predict the position of the vessel at the next hour. Finally, the
format of the second output is (samples, class), where class in this research stands for the number of ports being included in each
regions (as shown in Table 4 of Section 4.2.1). With the input data and targets being prepared and defined, the application of neural
network methods for each single-task prediction (Section 3.2.1) and the approach for utilizing them for combined prediction as a
multi-task model (Section 3.2.2) are being explained in the following of this section.

3.2.1. Neural network based methods


In the concept of deep learning, we can derive our models as 𝑓𝜃 (𝑦𝑝 |𝑥) in the case of trajectory prediction, and 𝑓𝜃 (𝑦𝑑 |𝑥) in the
case of destination prediction. 𝜃 is the parameters of the models. The objective then, would be to minimize the loss function 𝐿 for
the corresponding prediction tasks with respect to 𝜃. For trajectory prediction models, the objective can be denoted as:

1 ∑ ∑ (𝑖)
𝑁 𝐽
min 𝑇 (𝜃) = [ (𝑦 − ℎ𝜃,𝑇 (𝑥(𝑖) )𝑗 )2 ], (2)
𝜃 𝑁 𝑖=1 𝑗=1 𝑗

10
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Fig. 9. The architecture of the multi-task model for trajectory and destination prediction.

where 𝑇 (𝜃) is the cost function for trajectory prediction, 𝐽 is the number of neurons in the output layer, ℎ𝜃,𝑇 (𝑥) ∈ R2 is the output
layer computation, (ℎ𝜃,𝑇 (𝑥))𝑖 is the 𝑖th output of the neural network, and 𝑦(𝑖)
𝑗 indicates the trajectory target for the 𝑖th input, which
in the case of this study is the pair of latitude and longitude of the next timestamp during the 𝑖th trip. Hence, the format of 𝑦(𝑖)
𝑗 is
essentially going to be (𝜆, 𝜙), where 𝜆 and 𝜙 is the latitude and longitude of the vessel, respectively.
For the destination prediction models, the objective can be denoted as:

1 ∑ ∑ (𝑖)
𝑁 𝐾
min 𝐷 (𝜃) = − [ 𝑦 𝑙𝑜𝑔(ℎ𝜃,𝐷 (𝑥(𝑖) )𝑘 )], (3)
𝜃 𝑁 𝑖=1 𝑘=1 𝑘

where 𝐷 (𝜃) is the cost function for the destination prediction, 𝐾 is the class number (total ports), ℎ𝜃,𝐷 (𝑥) ∈ R𝐾 is the output layer
computation, (ℎ𝜃,𝐷 (𝑥))𝑖 is the 𝑖th output of the neural network, and 𝑦(𝑖)
𝑘
indicates the destination target for the 𝑖th input, which in
the case of this study represents the destination port of the 𝑖th trip.
The models are constructed with multiple neural network layers. In terms of the selections of neural networks, Wang et al. (2019)
mentioned that trajectories can be represented as sequence of locations as well as matrix so thus deep learning models such as LSTM
and Convolutional Neural Networks (CNN) can be applied. Hence, in this study, we have chosen LSTM, CNN, and DNN for training
the trip trajectories. Considering the performances of our predictions, the best neural network would be applied for the multi-task
prediction in the next part of the framework.

3.2.2. Multi-task learning model


Multi-task learning enables the model to learn a more general representation by sharing parameters between tasks (Ruder, 2017).
Suppose in the multi-task learning model, 𝑇 tasks are given. For this research, we consider the prediction of trajectory as task 𝑡 = 1
and destination as task 𝑡 = 2.  is the input data as denoted in Eq. (1). Two parts of the parameters are considered: task sharing
parameters 𝜃 and task-specific parameters {𝜓𝑡 }𝑇𝑡=1⋅ . 𝜃 denotes the parameters in the layers shared by all tasks and 𝜓𝑡 represents
the task specific output modules for task 𝑡. Let 𝑡 (; 𝜃, 𝜓𝑡 ) the task-specific loss function for task 𝑡, where the loss function can be
denoted as 𝑇 (𝜃) when 𝑡 = 1 (as shown in Eq. (2)) for trajectory prediction and 𝐷 (𝜃) when 𝑡 = 2 (as shown in Eq. (3)) for destination
prediction. Hence, the objective function of the model can be denoted as:

𝑇
𝑀𝑇 𝐿 = 𝑤𝑡 𝑡 (; 𝜃, 𝜓𝑡 ) (4)
𝑡=1

where 𝑡 (; 𝜃, 𝜓𝑡 ) denotes the average loss on  for task 𝑡 and {𝑤𝑡 }𝑇𝑡=1 are task-specific loss weights. As for loss weighing in this
paper, equally weighing (Lin et al., 2021) has been selected as a baseline with two more weights set using greedy search (Feo and
Resende, 1995) for task balancing and performance comparison.

11
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Fig. 10. Design of our experiments. The training data is generated with the knowledge extraction processes of our framework (see Fig. 2). Next, we compared
single-task models with different types of neural networks. Finally, we evaluate the performance of multi-task models on our prediction targets.

As a result, the loss function of the multi-task model should consider both targets at once, which is denoted as:

𝑀 = 𝑤𝑇 𝑇 + 𝑤𝐷 𝐷 , (5)

where 𝑤𝑇 and 𝑤𝐷 are the weights being assigned to each loss function. The chosen ratio (trajectory task 𝑤𝑇 to destination task 𝑤𝐷 )
for weights in this paper using equally weighing and greedy search are (1:1), (10:1), and (20:1), respectively.
Fig. 9 shows the architecture of the multi-task learning model. Our activation of all the hidden layers are set as ReLU (Nair and
Hinton, 2010). The input of the model is the input trajectory, while the port information is fed in as metadata inputs. The shared
layer in the model architecture allows parameter sharing between the two tasks. The network then splits off into different heads
for the prediction of each tasks, where the fully connect layer linked to each task can be defined as task-specific layers. The fully
connected layer is formulated as:

ℎ𝑊 ,𝑏 (𝑥) = 𝑓 (𝑊 𝑇 𝑥 + 𝑏), (6)

where 𝑥 is the input vector; ℎ𝑊 ,𝑏 is the output vector; 𝑏 is the corresponding bias; 𝑊 is the corresponding weights; and 𝑓 is the
activation function. The activation for the position output is linear, while softmax is selected as the activation for arrival port output.

4. Experiments and results

In this section, we first introduce the design of our experiments. Next, we describe the experiment setup including trajectory
data and training parameters that were used. Furthermore, the evaluation approach, including 2 interested criteria are discussed.
Finally, the detailed experimental results are presented.

4.1. Experimental design

Fig. 10 shows the design of our experiment. In general, the experiment is designed to test the effectiveness of the proposed model
over the 5 predefined regions. Specifically, we targeted at the followings:

• Model comparison. Compare the performances of different types of neural network models (single-task) for separate
predictions of vessel trajectories and destinations.
• Multi-task prediction. Construct multi-task models for combined predictions of vessel trajectories and destinations and
compare the results with the single-task models.

4.1.1. Model comparison


Three neural network models, including LSTM, CNN, and DNN, are being compared by evaluating their performances on
trajectory prediction. Each model takes in the preprocessed trajectory data as inputs to predict the vessels next hour trajectory.
In this step, we aim to explore the effectiveness of predicting trajectory with certain baseline deep learning methods within the
regions of interests. Moreover, with the same trajectory as inputs, the model takes departure ports of each trajectory as another type

12
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Fig. 11. Data distribution for regions.

Table 4
The number of selected ports and
extracted trips between Oct. 1,
2018 and Dec. 31, 2018.
Regions Ports Trips
NWE 39 1168
Atl 39 306
EstP 14 198
Med 21 179
ER 15 710

of input for destination port classification. Similarly, the performances of the three types of neural networks were being compared.
The results of the comparisons were taken into consideration for the construction of multi-task learning model in the following
phase.

4.1.2. Multi-task prediction


There are two targets of interest in the multi-task prediction phase: trajectory prediction and destination prediction. We select
the best neural network model from the model comparison phase and embed it into the multi-task learning model for a one-hour
trajectory prediction and destination port prediction. Both the loss of the one-hour trajectory and destination were taken into account
when training the model. In this phase, we aims to evaluate the effectiveness of destination prediction with the multi-task model
and compare the performance of the model when we assign different weights to the loss of two prediction outputs.

4.2. Experimental setup

In this subsection we introduce the data set used for the experiment, which is generated from the knowledge extraction phase
of our study. Next, we introduce some parameters that was used in our experiment.

4.2.1. Trajectory data


Fig. 11 shows the data distribution over different sea regions in this study. The AIS data regarding this project is global-based.
We filtered them into different regions for more focused and robust research results. Nonetheless, the scale of the prediction regions
is still larger than relative researches on maritime trajectory predictions mentioned in Section 2.
Each arc line in Fig. 11 represents a link between the start and end port of a trip that the vessel has traveled. The trajectories are
extracted from these port-to-port connections. Table 4 shows the number of selected ports and extracted trips for each sea region.
When processing the data for training, we transformed trips into 12-hour trajectories using sliding-window. Each trajectory is given
a next hour position and a destination as targets of prediction.

13
W. Wang et al. Maritime Transport Research 3 (2022) 100072

4.2.2. Training parameters


For each sea region experiments in the model comparison phase and the multi-task prediction phase, we split the data into
training sets (70%) and testing sets (30%). The training sets are sampled with Synthetic Minority Over-sampling Technique (SMOTE)
under Imbalanced-learn API (Chawla et al., 2002). We set the training epochs of the neural networks to 500 with batch sizes of
256. All training sessions are implemented under Keras with a server configured with an NVIDIA GP104 GPU.

4.3. Evaluation approaches

We consider two sets of criteria when exploiting the performance of the experiments. Regarding trajectory prediction, we focus
on the criterion of position. In terms of destination prediction, our focus lies in the criterion of port classification.

4.3.1. The criterion of vessel position


In predicting the next hour trajectory of the vessels, we adopt Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE)
as they are a frequently used measure of differences between predicted values and target values. Eqs. (7) and (8) show the definitions
of the metrics, where 𝑁 denotes the total number of testing trajectories, 𝑦 denotes the vector of actual position and 𝑦̂ denotes the
vector of predicted positions.

∑𝑁 2
𝑖=1 (𝑦𝑖 − 𝑦̂𝑖 )
𝑅𝑀𝑆𝐸 = (7)
𝑁

1 ∑
𝑁
𝑀𝐴𝐸 = |𝑦 − 𝑦̂𝑖 | (8)
𝑁 𝑖=1 𝑖

Furthermore, the geographic distance between the predicted positions and actual positions is also being evaluated. Since the
Haversine formula is generally used for navigation purposes (Mahmoud and Akkari, 2016), we used it to calculate the distance
error. The Haversine formula can be defined as Eq. (9). Thus, the Haversine distance between two coordinates can be calculated as
defined in Eq. (10). We computed the distance error for each observation in the testing data and calculate the mean distance error
𝐷𝑖𝑠𝑡𝑀 and the standard deviation of distance error 𝐷𝑖𝑠𝑡𝑆 for evaluation.
𝜃
𝐻𝑎𝑣𝑒𝑟𝑠𝑖𝑛𝑒(𝜃) = sin2 (9)
2
√ ( ) ( )
𝜃2 −𝜃1 𝜆2 −𝜆1
𝑑 = 2𝑟 𝑠𝑖𝑛−1 𝑠𝑖𝑛2 2
+ 𝑐𝑜𝑠(𝜃1 )𝑐𝑜𝑠(𝜃2 )𝑠𝑖𝑛2 2
(10)

4.3.2. The criterion of port classification


Regarding the accuracy of destination prediction, we explore whether the output of each testing observation are classified as the
actual port of destination. The destination accuracy is defined in Eq. (11), where 𝑁 denotes the total number of testing trajectories,
𝑦 denotes the vector of actual destinations, and 𝑦̂ denotes the vector of predicted destinations. In the meantime, the Area Under
Curve (AUC) is also included as a measure of evaluating the models’ performance (Bradley, 1997).
|𝑦 ∩ 𝑦|
̂ |𝑦 ∩ 𝑦|
̂
𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦(𝐴𝑐𝑐) = = (11)
|𝑦 ∪ 𝑦|
̂ 𝑁

4.4. Experimental results

Two parts of the experiment results were presented. As shown in the experiment design, the model comparison results correspond
to single-task predictions done with different types of neural networks. Next, the multi-task model results presents results for multi-
task prediction done with the best model selected from the model comparison phase. Both parts include experimental results of five
predefined regions.

4.4.1. Model comparison results


We compare the performance of the selected neural network models under two dimensions. The results for the experiments are
shown as follows:

• Trajectory prediction results. The performance comparison among different models on one-hour trajectory prediction is
presented in Table 5. The evaluation approaches for these results falls in the criterion of vessel position stated in Section 4.3.1.
We have also plotted cumulative distribution function (CDF) plots of the distance error within each regions, which is shown
in Fig. 12. In the meantime, we also included a CDF plot (Fig. 12(a)) for the overall distance error.
• Destination prediction results. The performance comparison among different models on vessel destination prediction is
presented in Table 5. The evaluation for approaches for these results falls in the criterion of port classification state in
Section 4.3.2. The Top1-Acc indicates the model’s accuracy of successfully predicting the destination port, while the Top5-Acc
indicates the model’s accuracy of correctly includes the destination port within its top five predictions.

14
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Table 5
The evaluation results of trajectory and destination prediction with different neural networks.
Region Model Trajectory Prediction Destination Prediction
RMSE MAE Dist𝑀 Dist𝑆 Top1-Acc Top5-Acc AUC
NWE CNN 0.044 0.021 0.652 0.391 0.350 0.810 0.776
NWE DNN 0.051 0.027 0.568 0.446 0.611 0.959 0.959
NWE LSTM 0.047 0.023 0.537 0.440 0.831 0.995 0.990
Atl CNN 0.052 0.030 0.430 0.326 0.735 0.984 0.942
Atl DNN 0.081 0.042 0.688 0.608 0.723 0.998 0.974
Atl LSTM 0.037 0.018 0.326 0.296 0.870 0.999 0.998
EstP CNN 0.134 0.079 0.825 0.532 0.894 1.000 0.974
EstP DNN 0.132 0.070 0.655 0.534 0.850 1.000 0.965
EstP LSTM 0.120 0.063 0.572 0.531 0.956 1.000 0.998
Med CNN 0.063 0.041 4.141 2.955 0.891 1.000 0.995
Med DNN 0.068 0.042 4.738 3.552 0.881 1.000 0.994
Med LSTM 0.055 0.038 4.071 2.606 0.905 1.000 0.999
ER CNN 0.087 0.066 5.247 1.956 0.545 0.926 0.821
ER DNN 0.098 0.071 6.217 3.616 0.575 0.912 0.815
ER LSTM 0.047 0.035 3.167 1.752 0.691 0.997 0.974
Avg CNN 0.076 0.047 2.259 1.232 0.683 0.944 0.902
Avg DNN 0.086 0.050 2.573 1.751 0.728 0.974 0.941
Avg LSTM 0.061 0.035 1.735 1.125 0.851 0.998 0.992

Fig. 12. Comparisons of the cumulative distribution function of distance error among five region and overall distance error for the three models.

Several observations were obtained from the experiment results. In Table 5, we can see that RMSE, MAE, and the mean and
standard deviation of distance error, hold positive correlations among the three models. The LSTM outperforms the others in general,
especially for the NWE, Atl, and ER regions. Moreover, we can observe lower distance errors for the LSTM in all regions. The average
of five regions also corresponds with the observations stated above. Regarding the performance among regions, we can see higher
losses within the Med and ER regions. On the other hand, relatively accurate predictions occur within the NWE and Atl regions. In
terms of distance error shown in Fig. 12, we can see from Fig. 12(a) that LSTM slightly surpasses the others while CNN and DNN
achieve comparable results. Furthermore, it can be seen that LSTM yields better performance in most regions except for Med, where
the distributions are overlapping. Nevertheless, the LSTM model still surpass the other two in terms of 𝐷𝑖𝑠𝑡𝑀 and 𝐷𝑖𝑠𝑡𝑆 for Med.
As for destination prediction comparison shown in Table 5, the results are diverse among different sea regions of the world in
terms of accuracy. The accuracy for EstP and Med are relatively higher than the others, while predicting the correct destination port
seems to be harder in the ER region for the model. However, the models in all the regions are able to achieve 90% accuracy for
Top5-Acc except for the CNN model in NWE region. Regarding the comparison of the neural networks, the LSTM model outperforms
the other two for all regions, with an average of 0.851 in Top1-Acc. The LSTM model performs relatively lower accuracy in the ER
region. On the other hand, the AUC of the LSTM model seems to have lower variation over different regions, with an average of
0.992. This indicates high discriminancy and consistency of the models.

15
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Table 6
The evaluation results of trajectory and destination prediction with multi-task learning.
Region W Trajectory Prediction Destination Prediction
RMSE MAE Dist𝑀 Dist𝑆 Top1-Acc Top5-Acc AUC
NWE 1,1 0.081 0.045 1.372 0.867 0.815 0.990 0.985
NWE 10,1 0.069 0.037 0.902 0.740 0.831 0.994 0.990
NWE 20,1 0.089 0.057 1.993 1.011 0.826 0.994 0.989
Atl 1,1 0.359 0.188 4.436 3.855 0.797 1.000 0.995
Atl 10,1 0.075 0.036 0.728 0.669 0.888 1.000 0.988
Atl 20,1 0.182 0.104 2.560 2.109 0.839 0.998 0.993
EstP 1,1 0.314 0.174 2.140 1.872 0.955 1.000 0.997
EstP 10,1 0.303 0.165 1.869 1.257 0.987 1.000 1.000
EstP 20,1 0.307 0.166 1.797 1.382 0.988 1.000 1.000
Med 1,1 0.168 0.121 12.591 7.172 0.919 1.000 0.997
Med 10,1 0.146 0.081 7.975 7.017 0.934 1.000 0.995
Med 20,1 0.207 0.134 13.641 8.669 0.930 1.000 0.997
ER 1,1 0.112 0.059 4.992 4.960 0.771 0.999 0.981
ER 10,1 0.143 0.089 6.919 5.272 0.761 0.995 0.978
ER 20,1 0.125 0.079 6.231 4.414 0.750 0.998 0.984
Avg 1,1 0.207 0.117 5.106 3.745 0.851 0.998 0.991
Avg 10,1 0.198 0.114 4.137 3.155 0.870 0.997 0.993
Avg 20,1 0.182 0.108 5.245 3.517 0.867 0.998 0.993

Fig. 13. Comparisons on the cumulative distribution function of overall distance error and each regions’ distance error for three different weights.

According to observations made from the results, we conclude that LSTM is more adequate for maritime trajectory and destination
prediction in this experiment. Hence, we selected the LSTM model and embedded it in the multi-task learning procedure for trajectory
and destination prediction.

4.4.2. Multi-task model results


Two outputs of the multi-task prediction model were evaluated in this section. The models were given different proportion of
weights 𝑊 for the loss of each task. The weights 𝑊 can be defined as 𝑊 = (𝑊𝑇 , 𝑊𝐷 ), where 𝑊𝑇 and 𝑊𝐷 are defined in Section 3.2.2.
The results for the experiments are shown as follows:

• Trajectory prediction results. The performances of trajectory prediction for the multi-task learning model are listed in
Table 6. Similarly, the CDF plots for distance error are shown in Fig. 13.
• Destination prediction results. The multi-task models’ performances on destination prediction are presented in Table 6.

In terms of trajectory prediction results, we can see that the models generally perform at their best when the weights are tuned
to (10,1). Exceptions occurs in the EstP region, where the performance is very close between the weights at (10,1) and (20,1) and
the ER region, where weights at (1,1) performs better than the other two. Fig. 13 reflects this observation with the weights at (10,1)

16
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Table 7
The average run time of a single input over selected regions for single-task and multi-task models.
LSTM (trajectory) LSTM (destination) LSTM (both) Multi-Task (ours)
Time (milliseconds) 52.3 41.4 93.7 41.8
Memories (GB) 1.91 1.91 3.82 2.11

dominating the other two in the NWE, Atl, and Med region, the performances overlapping in the EstP region, and the weights at
(1,1) performing slightly better for the ER region.
As for the destination prediction results, observations can be made that performance would peak in general when the weights
are set as (10,1) except for ER region. The performance of the destination prediction aligns with the performance of the trajectory
prediction. Nonetheless, we can observe that multi-task learning performs better in destination prediction compares to single-tasks
results in Section 4.3.2 with trade offs for relatively higher loss for trajectory prediction.
Comparing the results of single-task and multi-task models with vessel trajectory and destination prediction, we can find that:

• On the average optimal performance within the five selected sea regions, the single-task model achieved a distance error
of 2.762 kilometers less than the multi-task mode. On the other hand, the multi-task model performs better on destination
prediction than the single-task model by around 2 percent in the Top 1 accuracy.
• For certain region where the distribution of origin and destination converges to one area (as shown in the purple arc lines
in Fig. 11), such as ER, the effect of multi-task learning on destination prediction can out perform single-task by around 8
percent in accuracy. This suggest that in scenarios where single-task model cannot predict destinations with enough accuracy,
multi-task model can be adopted learning to predict trajectory as an auxiliary task thus gives the model a more general direction
into predicting vessel destinations with improved performance.
• In terms of computation time, Table 7 shows the average run time of a single input for single-task and multi-task models.
The results indicates that the computation time used for the two models are very similar, with Multi-task slightly faster.
This indicates that efficiency loss for multi-task model is relatively small, and the model should be adequate for deployment
application-wise.

4.5. Discussions

Trajectory and destination prediction have proven their importance in the area of maritime transportation. Currently, researches
that focus on the naval trajectory and destination predictions had performed well on specific regions of the world (e.g. Chen et al.,
2020; Valsamis et al., 2017). However, prediction methods on the predefined area of interests might not be applicable when
implemented on different scales or places. Applying deep learning models on global bases while segmenting the predictions in
regions may help researchers investigate and replicate the methods in their sea regions of interests. Furthermore, identifying the
links between trajectory prediction and destination prediction may also help in researches related to maritime spatiotemporal data
mining.
This study examined and compared deep learning architectures for maritime trajectory prediction in different parts of the world
to test their generality. We identified LSTM as an adequate deep learning model for generalized trajectory prediction in different
regions of the globe. A previous study demonstrated that the time-series model would require more data in terms of maritime
trajectory forecasting in general (Valsamis et al., 2017). This report is consistent with our finding that regions with more trips
extracted tend to have better performance (NWE). In the article, the author used a MLP with time series that achieved a mean
distance error of 4.61 kilometers for 30 min interval. The DNN model in our study is of the same architecture with the MLP model
in the article. Among the five regions, the model achieved 2.573 kilometers in mean distance error for a 1-hour interval. The LSTM
model did even better with an average mean distance error of 1.735 kilometers. Though direct comparisons between the two results
cannot be made since they have different training and testing instances, the relationship between two distance error demonstrates
the effectiveness of the models in trajectory prediction.
Predicting vessel trajectory as an auxiliary task enables the destination prediction model focus attention on vessels’ future path
with the multi-task learning architecture. On top of that, we compared the prediction results of destination prediction with and
without multi-task learning. We can see from Table 5 and Table 6 that models with multi-task learning can generally perform better
in vessel destination prediction. Regarding the relatively poorer prediction for ER region in the single-task learning, the multi-task
learning method dominated single-task prediction with a 10 percent increase on accuracy.
Besides, the proposed multi-task approach provides a efficient solution to achieve the prediction of trajectory and destination
simultaneously. Table 7 compares model efficiency between single-task LSTM and the proposed multi-task method. The proposed
approach prevents the system from deploying two models resulting in twice acceleration and half memory occupation at the
inference stage. The significant improvement of the computational efficiency enables the operators or clients to quickly screen
the motion of numerous ships in a large area. More screened ships better assists the operator in managing and monitoring the
maritime traffic, which can also contribute to related application domains such as collision avoidance and anomaly detection. In
this regard, the proposed multi-task method achieves better accuracy and higher efficiency in trajectory and destination prediction
than conventional single-task methods.

17
W. Wang et al. Maritime Transport Research 3 (2022) 100072

A limitation exists in destination prediction of the multi-task learning model in our study. We constructed the model in
the condition with predefined areas and lists of ports. This method is designed in a general manner so that it can be easily
implemented by related stakeholders and researchers with their areas of interest. However, as more ports are being considered
in the selected regions, the prediction accuracy of vessel destination is likely to drop since some ports would be highly confusable
when classified (Gupta et al., 2014). Otherwise, the method can be adopted for stakeholders that already know their ports of interest.
Future research can compare predictions within different scales of regions. Moreover, only spatial features in AIS messages
were taken into consideration in this research. Metadata like weather and ship type can have an impact on predicting vessel
trajectories and destinations. To what extent do these features affect prediction results is also worth researching. Finally, as a
baseline, researchers can apply this method to predict destinations within their ports of interest. Then, the predicted destinations
can become inputs for estimating other port-related activities such as commodities exchange volumes.

5. Conclusion

In this study, we proposed a computational framework, which can process the raw AIS data to extract origin–destination indices
and vessel voyages as knowledge, and utilize the knowledge to predict the vessels’ future trajectories and destinations with deep
learning models. For generalization, we extracted vessel voyages over different ocean-level regions and trained deep neural networks
for vessel route estimation. Modeling with the LSTM, CNN, and DNN networks, we discovered that the LSTM yielded better results
than the others for both vessel trajectory and destination prediction. Also, we found low destination prediction accuracy occurred in
certain ocean regions. A multi-task learning architecture was introduced to enhance destination prediction accuracy. With multi-task
learning, the model increased its accuracy by up to eight percent, with more general prediction results over the regions defined in
our experiments.
Global maritime trade is continuously expanding, while digitalization and automation are transforming the shipping sec-
tor (Valentine et al., 2013). As AIS is being investigated beyond its original use of preventing collision (e.g., vessel tracking for
cargo inspection coordination businesses), the prediction process and scale should be upgraded to better suit stakeholders’ needs.
The proposed framework provides such a process that can transform raw AIS data into trainable indices for deep learning in vessel
route estimation. In this way, the AIS data can be utilized in a more intuitive manner, where the process is reproducible and the
prediction is more general. Maritime inspection needs to focus on a broader range of vessel voyages than collision avoidance in terms
of vessel trajectory prediction. The expansion of the prediction scale in this research showcases deep neural networks’ capability in
vessel route estimation with wider ranges. The lack of accurate information regarding vessels’ destination may result in inefficient
port arrangements and traffic route guidance (Zhang et al., 2020). The proposed multi-task learning architecture in our framework
further improved the destination prediction accuracy in comparison with the models without such a mechanism. Thus, the proposed
framework can assist in maritime tasks covering more expansive geographic areas and provide knowledge about the future marine
status to the stakeholders more intuitively and robustly. Finally, although this is a novel study and our contributions focus mainly on
unleashing a multi-task concept under the circumstance of global maritime trajectory and destination prediction and the processing
of AIS data, this paper has some drawbacks that can be suggested as future works: (1). The trajectory prediction outputs only the
position of future 1 h instead of a series of points containing multiple hours in the future, which can be further investigated. (2).
Several loss weighing methods could be further investigated to better tackle the task balancing problem and improve the performance
of multi-task learning.

Declaration of competing interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared
to influence the work reported in this paper.

Acknowledgments

This research is sponsored by Spire, Navarik, and Mitacs through the Mitacs Accelerate program (grant No. IT13612).

References

Arguedas, V.F., Pallotta, G., Vespe, M., 2014. Automatic generation of geographical networks for maritime traffic surveillance. In: 17th International Conference
on Information Fusion. FUSION, Salamanca, Spain, pp. 1–8.
Baldauf, M., Benedict, K., Motz, F., 2008. Aspects of technical reliability of navigation systems and human element in case of collision avoidance. In: Proceedings
of the Navigation Conference and Exhibition, London, UK. London, UK, pp. 1–11.
Baxter, J., 1997. A Bayesian/information theoretic model of learning to learn via multiple task sampling. Mach. Learn. 28 (1), 7–39. http://dx.doi.org/10.1023/A:
1007327622663, https://doi.org/10.1023/A:1007327622663.
Bradley, A.P., 1997. The use of the area under the ROC curve in the evaluation of machine learning algorithms. Pattern Recognit. 30 (7), 1145–1159.
Caruana, R., 1993. Multitask learning: A knowledge-based source of inductive bias. In: Proceedings of the Tenth International Conference on Machine Learning.
Morgan Kaufmann, pp. 41–48.
Chawla, N.V., Bowyer, K.W., Hall, L.O., Kegelmeyer, W.P., 2002. SMOTE: Synthetic minority over-sampling technique. J. Artificial Intelligence Res. 16 (1),
321–357.
Chen, R., Chen, M., Li, W., Guo, N., 2020. Predicting future locations of moving objects by recurrent mixture density network. ISPRS Int. J. Geo-Inf. 9 (2), 116.
Feo, T.A., Resende, M.G.C., 1995. Greedy randomized adaptive search procedures. J. Global Optim. 6 (2), 109–133.

18
W. Wang et al. Maritime Transport Research 3 (2022) 100072

Forti, N., Millefiori, L.M., Braca, P., Willett, P., 2020. Prediction oof vessel trajectories from AIS data via sequence-to-sequence recurrent neural networks. In:
ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing. ICASSP, Barcelona, Spain, pp. 8936–8940.
Gaonkar, R.S.P., Xie, M., Huang, H.-Z., 2013. Optimizing maritime travel time reliability. Proc. Inst. Mech. Eng. M 227 (2), 167–176. http://dx.doi.org/10.1177/
1475090212460626.
Gulisano, V., Jerzak, Z., Smirnov, P., Strohbach, M., Ziekow, H., Zissis, D., 2018. The DEBS 2018 grand challenge. In: Proceedings of the 12th ACM International
Conference on Distributed and Event-Based Systems. DEBS ’18, Hamilton, NZ, pp. 191–194.
Gupta, M.R., Bengio, S., Weston, J., 2014. Training highly multiclass classifiers. J. Mach. Learn. Res. 15 (1), 1461–1492.
Hexeberg, S., Flåtent, A.L., Eriksen, B.-O.H., Brekke, E.F., 2017. AIS-based vessel trajectory prediction. In: 2017 20th International Conference on Information
Fusion (Fusion). Xi’an, China, pp. 1–8.
Iphar, C., Napoli, A., Ray, C., 2015. Detection of false AIS messages for the improvement of maritime situational awareness. In: Oceans 2015 - MTS/IEEE
Washington. Washington, USA, pp. 1–7.
Lecun, Y., Bengio, Y., Hinton, G., 2015. Deep learning. Nature 521 (7553), 436–444.
Li, W., Zhang, C., Ma, J., Jia, C., 2019. Long-term vessel motion predication by modeling trajectory patterns with AIS data. In: 2019 5th International Conference
on Transportation Information and Safety. ICTIS, Liverpool, UK, pp. 1389–1394.
Lin, C.-X., Huang, T.-W., Guo, G., Wong, M.D.F., 2018. Mtdetector: A high-performance marine traffic detector at stream scale. In: Proceedings of the 12th ACM
International Conference on Distributed and Event-Based Systems. Hamilton, NZ, pp. 205–208.
Lin, B., Ye, F., Zhang, Y., 2021. A closer look at loss weighting in multi-task learning. ArXiv e-prints arXiv:2111.10603.
Liu, L., Qiu, Z., Li, G., Wang, Q., Ouyang, W., Lin, L., 2019. Contextualized spatial–temporal network for taxi origin-destination demand prediction. IEEE Trans.
Intell. Transp. Syst. 20 (10), 3875–3887.
Liu, J., Shi, G., Zhu, K., 2019. Vessel trajectory prediction model based on AIS sensor data and adaptive chaos differential evolution support vector regression
(ACDE-SVR). Appl. Sci. 9 (15), 2983.
Mahmoud, H., Akkari, N., 2016. Shortest path calculation: A comparative study for location-based recommender system. In: 2016 World Symposium on Computer
Applications Research. WSCAR, Cairo, Egypt, pp. 1–5.
Næss, P., 2018. Investigation of Multivariate Freight Rate Prediction Using Machine Learning and AIS Data (Master’s thesis). Norwegian University of Science
and Technology.
Nair, V., Hinton, G.E., 2010. Rectified linear units improve restricted boltzmann machines. In: Proceedings of the 27th International Conference on International
Conference on Machine Learning. ICML ’10, Madison, WI, USA, pp. 807–814.
National Geospatial-Intelligence Agency, 2019. World port index (PUB 150) - Maritime safety information. URL: https://msi.nga.mil/Publications/WPI.
Nguyen, D.-D., Le Van, C., Ali, M.I., 2018. Vessel trajectory prediction using sequence-to-sequence models over spatial grid. In: Proceedings of the 12th ACM
International Conference on Distributed and Event-Based Systems. Hamilton, NZ, pp. 258–261.
Pallotta, G., Vespe, M., Bryan, K., 2013. Vessel pattern knowledge discovery from AIS data: A framework for anomaly detection and route prediction. Entropy
15 (6), 2218–2245.
Rec. ITU-R M.1371-5, I.T.U., 2014. Technical characteristics for an automatic identification system using time-division multiple access in the VHF maritime
mobile band. Geneva, Switzerland.
Res. A.1106(29), I.M.O., 2016. Revised guidelines for the onboard operational use of shipborne automatic identification systems (AIS). London, UK.
Ruder, S., 2017. An overview of multi-task learning in deep neural networks. ArXiv e-prints arXiv:1706.05098.
Schubert, E., Sander, J., Ester, M., Kriegel, H.P., Xu, X., 2017. DBSCAN revisited, revisited: Why and how you should (still) use DBSCAN. ACM Trans. Database
Syst. 42 (3), 1–21. http://dx.doi.org/10.1145/3068335.
Spiliopoulos, G., Zissis, D., Chatzikokolakis, K., 2018. A big data driven approach to extracting global trade patterns. In: Doulkeridis, C., Vouros, G.A., Qu, Q.,
Wang, S. (Eds.), Mobility Analytics for Spatio-Temporal and Social Data. Springer International Publishing, Cham, pp. 109–121.
Sutherland, I.E., Sproull, R.F., Schumacker, R.A., 1974. A characterization of ten hidden-surface algorithms. ACM Comput. Surv. 6 (1), 1–55.
Tang, H., Yin, Y., Shen, H., 2019. A model for vessel trajectory prediction based on long short-term memory neural network. J. Mar. Eng. Technol. 1–10.
Team GeoPandas, 2013-2019. GeoPandas: Python tools for geographic data. URL: https://geopandas.org/.
Tu, E., Zhang, G., Rachmawati, L., Rajabally, E., Huang, G., 2018. Exploiting AIS data for intelligent maritime navigation: A comprehensive survey from data to
methodology. IEEE Trans. Intell. Transp. Syst. 19 (5), 1559–1582. http://dx.doi.org/10.1109/TITS.2017.2724551.
Urban Computing Foundation, 2018. kepler.gl. URL: https://kepler.gl.
Vafaeipour, M., Rahbari, O., Rosen, M.A., Fazelpour, F., Ansarirad, P., 2014. Application of sliding window technique for prediction of wind velocity time series.
Int. J. Energy Environ. Eng. 5 (2), 105.
Valentine, V.F., Benamara, H., Hoffmann, J., 2013. Maritime transport and international seaborne trade. Marit. Policy Manage. 40 (3), 226–242.
Valsamis, A., Tserpes, K., Zissis, D., Anagnostopoulos, D., Varvarigou, T., 2017. Employing traditional machine learning algorithms for big data streams analysis:
The case of object trajectory prediction. J. Syst. Softw. 127, 249–257.
Wang, S., Cao, J., Yu, P.S., 2019. Deep learning for spatio-temporal data mining: A survey. ArXiv e-prints arXiv:1906.04928.
Zhang, C., Bin, J., Wang, W., Peng, X., Wang, R., Halldearn, R., Liu, Z., 2020. AIS data driven general vessel destination prediction: A random forest based
approach. Transp. Res. C 118, 102729.
Zhang, W., Goerlandt, F., Kujala, P., Wang, Y., 2016. An advanced method for detecting possible near miss ship collisions from AIS data. Ocean Eng. 124,
141–156.
Zhang, L., Meng, Q., Xiao, Z., Fu, X., 2018. A novel ship trajectory reconstruction approach using AIS data. Ocean Eng. 159, 165–174. http://dx.doi.org/10.
1016/j.oceaneng.2018.03.085.
Zhao, L., Shi, G., Yang, J., 2018. Ship trajectories pre-processing based on AIS data. J. Navig. 71 (5), 1210–1230.
Zheng, Y., 2015. Trajectory data mining: An overview. ACM Trans. Intell. Syst. Technol. (TIST) 6 (3), 1–41.

19

You might also like