# Grid-Based Vessel Deviation from Route Identification with Unsupervised Learning
###### Abstract  
The application of anomaly-monitoring and surveillance systems is crucial for improving maritime situational awareness. These systems must work on the fly in order to provide the operator with information on potentially dangerous or illegal situations as they are occurring. We present a system for identifying vessels deviating from their normal course of travel, from unlabelled AIS data. Our approach attempts to solve problems with scalability and on-line learning of other grid-based systems available in the literature, by applying a dynamic grid size, adjustable per vessel characteristics, combined with a binary-search tree method for data discretization and vessel grid search. The results of this study have been validated during the Portuguese Maritime Trial in April 2022, conducted by the Portuguese navy along the southern coast of Portugal. vessel trajectories; anomaly detection; maritime security +
Footnote †: journal:  
and whose data from navigating vessels is fed by the real-time stream of data received by coastal authorities. The presented work has the satellite-based automatic identification system (AIS) as the fundamental basis, in order to infer the position and characteristics of vessels present in the maritime space. These messages, transmitted over very high frequency (VHF) audio waves, enable information such as the type of message, the vessel's maritime mobile service identity (MMSI), timestamp, latitude and longitude of the vessel, speed, course, heading information, and type of manoeuvre, among other things, to be exchanged between vessels and the shore in real-time [3]. The AIS system comes with important limitations. First, considering the system is reliant on the sensor information, measured in each vessel, this means that the received information will only be as accurate as the information measured by the per-vessel sensors. The reliance on the received AIS information for maritime control by officers on watch can also be seen as a downside. The possibility of tampering with sensors to send erroneous information, or to stop transmitting by turning off the AIS system, makes the duty of the officers in charge very difficult. The fact that not all ships are fitted with AIS means small vessels may not appear in the system. Unlike the long-range identification and tracking (LRIT), which uses closed-loop satellite communication [4], the AIS works as a VHF broadcast system, limited to the range of the VHF waves. The broadcast nature of AIS also means this information is available to everyone in the vicinity and may lead to the transmission of erroneous information from another ship, which does not happen in LRIT communication. Considering the high volume of data received, which may include over 1,500,000 messages every day, it is of little to no use without the appropriate set of tools that can help the operators extract information and knowledge regarding the maritime subspace in an automatic way. The present problem of learning how to identify vessels performing abnormal trajectories and learn on the fly is especially complex considering that there seem to be no publicly available labelled datasets for this task. As such, we utilise an unlabelled dataset of past AIS message data for extracting meaningful information from the structured data of vessel motion paths. The focus of this study is to present an advance in the automatic identification of vessels deviating from their normal route of operation by extracting per-vessel information  
Figure 1: Heatmap showing the total number of AIS messages received per each grid location on the map. A darker brown colour indicates a lot of messages have been sent from that particular location. We can clearly see a higher number of messages sent from locations of ports and from common navigational corridors used by vessels. June 2018.  
of the common trajectories. We present a system that can learn the unique navigational patterns for each vessel on the fly being able to identify and alert abnormal behaviours on the sea.