International Journal
on Marine Navigation
and Safety of Sea Transportation
Volume 4
Number 3
September 2010
303
1 INTRODUCTION
Analysis of ship traffic receives focus as the aware-
ness of the risk it poses to the environment is in-
creased. The analysis is not only motivated by the
desire to quantify risk, but also to understand the ef-
fect of changes to the fairway and to propose im-
provements to harbor areas and inland waterways.
Analysis of ship traffic has been hindered by a scar-
city of data, requiring specialized installations or
equipment for data collection. This scarcity has
prompted studies that rely on synthetic ship maneu-
vering data from simulators (Hutchinson 2003) and
(Merrick 2003). While simulator studies provides
valuable insights, through high sample rates, con-
trolled environment and absence of noise, they make
compromises on either the number of passages with
the use of human operators in full-mission simula-
tors, or on accuracy by eliminating the human ele-
ment and relying on fast-time simulators with auto-
pilot algorithms.
We will in this paper show how the introduction
of the Automatic Identification System (AIS) for
ships can help in both providing a readily available
data source for traffic analysis, and how analysis of
this data can be employed to generate statistics of
traffic conditions, estimate maneuver plans and pa-
rameters as inputs to fast-time simulator studies
The use of AIS in marine traffic analysis is not a
new concept. (Gucma 2007) used AIS data to esti-
mate the occurrence of accidents in the Baltic Sea by
identifying the major traffic flows using AIS records
of journeys. Little work has been done to apply AIS
to analysis on the scale of maneuvers in a smaller or
constrained area to derive the exhibited maneuver
patterns. The area around the harbor of Risavika in
southwestern Norway was selected as a case study.
This area was selected since the presence of island
formations and the coastline should impose a struc-
ture on the ship traffic. Information about all the
navigational markings in the area was obtained from
the Norwegian Hydrographic Service and contained
data for position, type and identifiers for all publicly
maintained navigational aids in the area. The area
with AIS position reports and navigational markings
indicated is shown in Figure 1.
Figure 1: Risavika harbor with AIS position reports and navi-
gation markers indicated
Computer Vision and Ship Traffic Analysis:
Inferring Maneuver Patterns From the
Automatic Identification System
K. G. Aarsæther & T. Moan
Norwegian University of Science and Technology, Trondheim, Norway
ABSTRACT: The Automatic Identification System has proven itself as a valuable source for ship traffic in-
formation. Its introduction has reversed the previous situation with scarcity of precise data from ship traffic
and has instead posed the reverse challenge of coping with an overabundance of data. The number of time se-
ries available for ship manoeuvring analysis has increased from tens, or hundreds, to several thousands. Sift-
ing through this data manually, either to find the salient features of traffic, or to provide statistical distribu-
tions of decision variables is an extremely time consuming procedure. In this paper we present the results of
applying computer vision techniques to this problem and show how it is possible to automatically separate
AIS data in order to obtain traffic statistics and prevailing features down to the scale of individual manoeu-
vres and how this procedure enables the production of a simplified model of ship traffic.
304
The small-scale analysis benefits from the large
volume of data available, but the size of the data sets
involved makes analysis more demanding. At this
level the analysis method must take into account the
alternate routes through the area and the possibility
of harbors.
The introduction of AIS has replaced the previous
scarcity of ship traffic and maneuver data with an
overabundance. Whereas one previously had to con-
struct limited shore based measurement systems
with limited lifespan or rely on data from a selected
set of vessels with logging equipment, AIS provides
a continuous stream of information of the position
and speed all AIS enabled vessels in range. The sys-
tem provides position and speed updates on prede-
fined intervals depending on vessel speed and ma-
neuver situation with a sample-rate varying from 3
seconds for high speed or turning vessels to 15 min
for ships at anchor. The instantaneous information
density varies naturally with the traffic density of the
area, but if one considers past data, the amount of in-
formation to be shifted through and analyzed is con-
siderable. The ability to analyze, and the capabilities
of the techniques employed, will determine the qual-
ity of information about ship traffic extracted from
this new source of historic ship traffic data.
On this background we present a method based
on computer vision techniques, which is capable of
handling this increase in available data.
2 METHOD
Analyzing ship traffic is a two-stage process where
the first task is to transform the collected data into a
form that eases the final analysis. A method for
transformation of AIS data frames to a collection of
maneuvers presented is comprised of following
stages:
Reconstruction of vessel specific time-series from
AIS data
Sorting of time-series from geometric similarity
of the position trace
Subdivision of the geometric similar groups into
groups with the same direction of travel
This process produces groups of time-series with
similar maneuver patterns and direction of travel
well suited for generation of statistics and further
analysis. Further analysis of these groups can in-
clude:
Traffic properties such as distribution of vessel
velocity and spread
Estimation of maneuver sequence and parameter
statistics
Estimation of the most probable navigation aid
used for maneuver transitions
2.1 Model for ship maneuvers
The ship maneuvering process is represented as a
sequence of basic maneuvers. The basic maneuvers
are instantiated and appear as a recognizable maneu-
ver pattern. The most basic subdivision of maneuver
patterns is the distinction between constant course
and course changing maneuvers. While these catego-
ries can contain variations in the strategies employed
to obtain the desired result, the two groups are repre-
sents the simplest geometric model is the model ship
maneuvering.
2.2 AIS data collection
Data frames from the Norwegian AIS stations in the
area around the harbor of Risavika were collected
for three months from April to June 2006. AIS data
frames are marked with a time stamp and the vessel
specific MMSI number and contains the vessels in-
stantaneous position and speed if available.
The data was ordered by MMSI number and time
to recreate the time-series for each vessel. The time-
series was then split at significant discontinuities in
time to handle the cases of vessels leaving the stud-
ied area or coming to rest in a harbor. The number of
AIS position reports in the area was 512,533 and the
position reports were reduced to 2763 time-series
2.3 Grouping of time-series
Application of image registration techniques solves
the laborious task of grouping the time-series form
the geometric similarity of the position trace.
Image registration techniques (Zitova 2003,
Brown 1992) is applied in medical imaging and pro-
duction control, and can be explained as the process
of comparing images mathematically to produce an
objective measure of their similarity and to detect
the presence of a-priori known objects. These tech-
niques are well suited for sorting vessel trajectories
from their geometry as the position trace in isolation
forms a line in an otherwise empty space. The trace
of a vessels position can be transformed into the
form of a digital image by discretization of the re-
ported position. The studied area was dividend into
75x75m bins and the number of position in each bin
was counted and stored in a matrix for each time se-
ries. This is the representation used for grayscale
images in image analysis.
Application of image registration must account
for the possible differences in image resolution, rota-
tion and translation of the captured scene. These pa-
rameters are controlled due to the transformation of
remotely sensed data into an image with controlled
orientation and resolution, but the location of the
imprint of the individual vessel traces introduces an
unknown possible translation. An application of im-
305
age registration to group geometric similar tracks
must account for this displacement within each
group, but a global compensation will introduce er-
rors, as it will detect similar position traces of simi-
lar form, but of very different location.
To reduce processing time the sorting of position
traces was divided into a coarse and detailed analy-
sis. The coarse analysis simply looked at the corre-
spondence of track images without accounting for
possible translations. If two images were deemed
similar, future comparison was done with the mean
track of the two. The coarse analysis left a large
number of small groups, which were used as inputs
to the detailed analysis. The detailed analysis made
use of numerical optimization to find the optimum
level of similarity between the groups. The cross-
correlation between two images, where one has a
translation (u,v) in (x,y) direction was used as an ob-
jective function and is seen in Equation (1).
)),(,),(max(
),(),(
),(
=
x y
vyuxI
x y
yxT
x
vyu
y
xIyxT
vuCCR
(1)
where T=reference image matrix and I=the test
image matrix with translation (u,v). The cross-
correlation defined in Equation (1) is only valid for
integer values (u,v) so a 3D interpolation method
from (Vetterling 2007) was implemented to provide
a continuous formulation of the cross-correlation.
The interpolation routine allows standard numerical
optimization strategies, such as steepest descend, to
be applied to find the maximum correlation between
two images. The cross-correlation was used to refine
the grouping obtained by the coarse method by an it-
erative process where groups which showed a max-
imum correlation where combined.
The final operation on the sorted time series was
to split each geometrically similar group into direc-
tion specific groups by considering the angle be-
tween the start and end points of each time-series.
2.4 Group maneuver identification
The time-series reconstructed from AIS have heter-
ogeneous sample rates, within the geometric similar
group, and even within the individual time-series.
This necessitates a transfer of individual time series
data to a common representation, which compen-
sates for the variations in sample-rates. The proper-
ties of the time series group was estimated from 100
evenly spaced control points. The control points
were computed as the mean points of 100 evenly
spaced points for each time-series belonging to the
group. Mean perpendicular vectors to the mean path
were calculated in conjunction with the control
points and used to establish mapping of the time-
series indices to the control points by finding the in-
tersection between the time-series trace and the per-
pendicular vectors.
The sequence of maneuvers in a group was
tracked by the curvature of the vessels trajectory.
The curvature of the vessel trajectories in each time
series was computed by considering the x and y co-
ordinate as signals in the time (Aarsæther 2007) as
seen in Equation 2.
( )
2/3
22
yx
xyyx
+
=
κ
(2)
A polynomial was fitted locally to the x and y
signals in time to provide well-defined derivatives
for curvature calculation. The curvature of each time
series was transferred to the group by the index to
control point mapping. The group curvature is then
calculated from the median of the group curvature at
each control point. The individual turn and straight
sections of the group are identified by an ad-hoc
two-stage filtering based on statistics. The mean
value,
µ
, and standard deviation,
σ
, are calculated
and the points of the group curvature curve that falls
outside the region defined by
are defined as
belonging to a turn section,
µ
and
σ
are recalculated
for the remaining points and the process repeated
once more. Contiguous regions are identified as turn
and straight segments.
The indentified turns in the group curvature only
provide information about the median straight and
turn behavior, to extend the analysis to the parame-
ters of the maneuver model and to provide statistics
demands data for the identified sections from each
time-series. The translation between the turn sec-
tions of the median path to the individual time series
is not well defined as the map of positions to control
points. Variations in curvature can occur at different
positions along the path and it is the sequence of
maneuvers that is of interest. The turn sections of the
median curvature were isolated and transferred to an
image representation using the same procedure as
for the position trace. The image representations of
the individual turn sections were then matched to a
section of the time-series by optimization of the sim-
ilarity between the turn image from the group curva-
ture and the time-series curvature. This identifies the
locations of the turn sections in the individual time-
series and enables the extraction of statistics based
on the maneuver progression of the individual ves-
sels instead of relying on geometric areas or indices
from the group curvature to extract data.
2.5 Statistics of time-series groups
Statistics for each time-series group was calculated
at the intersection between straight ant turn sections.
The sections of the individual time-series sections
were transferred to the group sections by mapping
the turns in a time-series to the corresponding turn
numbers in the group. Variables were according to
section type
306
Turn section: extreme, median & mean curvature
and median speed over section
Straight section: average course angle over sec-
tion, offset from median path at both endpoints
and median speed over section
2.6 Identification of navigational aids
The identification of the most used navigational aids
is dependent on the location of the border points be-
tween the straight and circular sections of the ships
path in relation to the navigational markings in the
environment.
The identification of the most probable naviga-
tional aid is more error prone than processing of AIS
data since the result is directly influenced by the
choice of criterion used to identify the aid used in
each time-series. The identification criterion used is
based on ship-handling theory, where navigation
references are preferred if the bearing from the turn
initiation point to the reference is close to parallel
with the future course. The angle to all the naviga-
tional markings in the area was calculated for each
turn initiation, and the marking with a bearing clos-
est to the course at the turn exit was chosen as the
most navigation mark in use.
3 RESULTS
The entire collection of AIS data frames was stored
in an SQL database for easy management and ex-
traction. Data frames was selected according to area
and ordered by time and MMSI number. The image
registration routines and data processing was im-
plemented in MATLAB. The time-series was con-
verted to images with the hist3 function of Math-
works’ “statistics toolbox” for MATLAB, and
optimization of image similarity was handled by the
constrained optimization function fmincon from “op-
timization toolbox” with gradient descend search.
3.1 Separation of traffic
Traffic clustered in seven groups, in addition groups
consisting of one to five time-series was also pre-
sent, but these have lack the numbers required to
proclaim them as traffic-groups. Of the seven major
groups one group consisted of AIS position reports
of vessels at anchor in the harbor and was excluded
from further analysis. The number of time-series in
the other six groups, as well as the breakdown in di-
rectional groups, is seen in Table 1
Table 1. Distribution of time-series into groups of geometric
similarity
___________________________________________________
Group Total Direction 1 Direction 2
___________________________________________________
1 1017 443 573
2 809 436 373
3 76 16 60
4 552 240 311
5 17 4 13
6 11 2 9
___________________________________________________
The geometric group of time-series belonging to
the five first groups is seen in Figure 2-6. Time-
series group six is excluded since it is only a small
component intersecting with the areas northeast cor-
ner.
Figure 2: Position trace of time-series in group 1
Figure 3: Position trace of time-series in group 2
Figure 4: Position trace of time-series in group 3
307
Figure 5: Position trace of time-series in group 4
Figure 6: Position trace of time-series in group 5
For further analysis based on statistics, only the
three densest populated geometric groups should be
considered. This is due to the uncertainty associated
with statistical analysis of small populations and to
avoid drawing conclusions on a weak statistical
base.
3.2 Maneuver sequences and statistics
Maneuver sequences were identified and statistics
for traffic properties and maneuver parameters were
produced. The measured variables were fitted both
to the normal and skew-normal (Azzalini 1985)
probability distributions. The skew-normal distribu-
tion was introduced to compensate for expected
skewness in the data that could severely influenced
the accuracy of the normal fit. Statistic calculations
and fitting of distributions was performed with “R”
with the “MASS” and “SN” statistic libraries. The
median paths with turn section border points indicat-
ed are shown in Figure 7.
Due to space limitations a full treatment is only
possible for one direction in one of the sample
groups. The direction group 1 of sample group 4 is
analyzed further. The parameters of fitted skew
normal probability distributions of the traffic param-
eters are shown in Table 2.
Figure 7: Median traffic paths with turn sections indicated.
Table 2. Parameters for traffic statistics for group 4, direction 1
___________________________________________________
Section Type Variable Location Scale Shape
___________________________________________________
1* Turn k.ext [1/m] -5.20e-4 2.75e-3 -14.6
speed [kn] 5.5 3.42 3.05
2 Straight offset start [m] 19.7 37.3 -1.13
offset end [m] -37.5 64.6 0.85
course [rad] -0.90 0.08 1.89
speed [kn] 7.9 3.7 2.51
3 Turn k.ext [1/m]-4.21e-4 7.36e-4 -9.34
speed [kn] 8.3 4.15 3.12
4 Straight offset start [m] -100.4 155.0 1.74
offset end [m] -120.6 163.9 2.36
course [rad] 0.012 0.053 1.18
speed [kn] 8.5 4.30 3.48
___________________________________________________
* S
tart section inside harbor
From Table 2 it is possible to track the increase in
both the vessel speed and spread from median posi-
tion from the harbor area to the edge of the studied
area. The curvature of the turn sections shows that
the course-changing maneuver in section 3 can be
modeled as a turn-circle maneuver with a radius of
approximately 1.25 nautical miles.
The goodness of fit between the data from the
AIS time-series and the skew-normal probability
distribution function can be seen in Figures 8-10
where the empirical density function is plotted to-
gether with the fitted distribution functions.
Figure 8: Extreme value of curvature during turn.
308
Figure 9: Offset from median position at end of turn (start of
next section)
Figure 10: Median speed over turn section
3.3 Navigational aids
The identification of navigational aids made use of
the information of navigational markings in the area
as provided by the Norwegian hydrographic Service,
but excluded markings consisting of iron poles used
to mark shallows. This left only lighthouses and
light buoys. Identification showed good consistency
with only two to three objects contributing the ma-
jority of observed identifications. For the initiation
of the turn in section three seen in Table 2 the rela-
tive contributions are shown in Figure 11
Figure 11: Relative frequency of identified used navigational
aid
From Figure 11 it is apparent that the navigation-
al markings at the location “Nesjaflua” dominates as
the most probable navigational mark. The distribu-
tion of course angles between the two most used
markings is seen in Figure 12, the overlapping
notches in the plot indicates that there is no statisti-
cally significant difference between the median ap-
parent angle to the markings.
Figure 12: Distribution of apparent angle to landmark, box
width indicates sample size.
4 CONCLUSION
It has been demonstrated that image registration
techniques can provide an efficient and accurate so-
lution to the problem of shifting through large
amounts of position reports from AIS and prepare
them for analysis in groups. Image registration also
overcomes the problem of identification of turn ma-
neuvers in individual time-series. The group analysis
of the AIS position reports enables the identification
of statistical parameters for the traffic flow, as well
as of probable navigational marks for turn initiations
and turn radi.
REFERENCES
Aarsæther K. G. & Moan T. 2007. Combined Maneuvering
Simulations, AIS and full-mission simulations. In Adam
Weintrit (ed) Advances in marine navigation and safety of
sea transportation; proc 7. intern. symp. on navigation
Gdynia 20-22 June 2007
Azzalini A. 1985. A class of distributions which include the
normal ones. Scandinavian Journal of Statistics 12:171-178
Brown L. G. 1992. A survey of image registration techniques.
ACM computing Surveys 24:325-376
Gucma L. & Goryczko E. 2007. The implementation of oil
spill cost model in the southern Baltic Sea area to assess the
possible losses due to ship collisions. In Adam Weintrit
(ed) Advances in marine navigation and safety of sea trans-
portation; Proc 7. intern. symp. on navigation Gdynia 20-
22 June 2007
Hutchison, B.L.; Gray, D.L. & Mathai, T., 2003. Maneuvering
simulations - an application to waterway navigability.
Transactions of the Society of Naval Architects and Marine
Engineers Vol 111:485-516
Merrick J.R.W.; van Dorp J.R.; Blackford J.P.; Shaw G.L.;
Harrald J. & Mazzuchi T.A. 2003. A traffic density analysis
of proposed ferry service expansion in San Francisco Bay
using a maritime simulation model. Reliability Engineering
and System Safety. Vol 81(2):119-132
Vetterling W.T.; Press H. P.; Teukolsky S. A.; Flannery B. P.
2007. Numerical recipes the art of scientific computing.
Cambridge university press
Zitová B. Flusser J. 2003. Image registration methods: a sur-
vey. Image and vision computing 21(11):977-1000