Zerua Tech Logo

AIS Data Preprocessing: Cleaning Ship Tracks

Date: Monday, Jan 8th 2024, 08:38
Share on
Share on Twitter
Share on Facebook
Share on LinkedIn
Cargo ships at anchor in a calm bay among small islands at dusk
Ship-tracking data from the Automatic Identification System (AIS) is the raw material of much of today's maritime analysis, from traffic density maps to arrival time prediction. But raw AIS data is full of errors, and models built on it can inherit them. A 2018 study from Dalian Maritime University cleaned about 110 million AIS position messages from the Zhoushan Islands in China, sorted the errors into three quality dimensions, and found that even the time stamps can be off by an hour or more.

What AIS data is

Ships broadcast their identity, position, speed and other information through AIS transceivers. They are mandatory for ships of 300 gross tonnes and above on international voyages, for cargo ships of 500 gross tonnes and above on other voyages, and for all passenger ships. There are 27 message types, and the study used the position reports and the static information reports. Seven fields are enough to describe a track: the ship's identification number (MMSI), longitude, latitude, speed over ground, and the hour, minute and second. Two more, ship type and length, add context. The data came from the AIS data center of the Chinese Maritime Authority in Ningbo: 110.6 million position reports and 40.6 million static reports from about 21,600 ships, recorded in January and February 2015.

Physical integrity: invalid messages and tracks

The first quality dimension asks whether each message and each track is valid. Some messages break the rules of the standard: 4.25% of one common type of position message had a latitude or longitude beyond the allowed maximum, 2.57% carried an impossible number of seconds, and a few carried an impossible speed. Static information is no better: 8.4% of the ships reported an unreliable ship type and 5.5% an unreliable length. A track can also be unusable as a whole, for example when it has too few points or no matching static information. Earlier studies had already found that in one busy strait more than half of the reported destinations were wrong.
Glowing lines radiating in all directions from one point over a coastal map

Spatial logic: tracks that make no sense

The second dimension asks whether the points of a track fit together. About 12% of the ships (12.36%) produced random position errors, such as a single point that jumps far away and returns, or a run of consecutive outliers. The identification number is supposed to be unique, but it is sometimes used by several ships at once, on purpose or by mistake, so that one track jumps between distant places. The study found 127 numbers that appeared in reports from both classes of onboard device, which obviously come from different ships. Finally, tracks that cross land or run along the border of the study area are artifacts, created when points of a ship that left and re-entered the area are joined.

Time: the hidden error

Each message has a time recorded by the receiving station, and some also carry the time generated by the ship's own device. The difference between the two should be a second or two, and for 94% of the messages it is. But only 15.7% of the Class A position reports and 1.2% of the Class B reports carry the generated time at all. Where both exist, some tracks show a steady delay of 6,439 seconds, about an hour and three quarters, which may come from signal delay, and others show wrong values around midnight or generated times that suddenly become zero. In all, 146 track segments had an average deviation of more than an hour. Such errors matter when time decides who was where, for example in accident investigations.

How the cleaning works

The method follows the three dimensions. First it discards messages that break the standard, and tracks with fewer than 100 points or without matching static information. Then it cuts each track wherever the movement is not plausible, at a break in the speed (a gate of 15 knots between the reported and the calculated speed) or a gap of more than 10 minutes, and tries to reconnect the pieces that fit together. Single outlier points end up isolated and are dropped, and ships that share one identification number fall apart into separate, regular tracks. For time, the method calculates the difference between the recorded and the generated time for each point, removes obvious errors, and corrects the time with the typical difference of the track, taken as the average when it is stable and as the most likely value otherwise.
Two ships with bright wakes crossing a dark sea at night beside a lit coastline

The results

From 110.6 million position messages and about 21,600 identification numbers, the method produced 106,245 clean track segments. It discarded 1.27% of the points in the space cleaning and only 0.42% in the time correction. On the maps, the jumps and the tracks across land are gone, and the tracks of ships sharing a number are separated into regular tracks. Density maps of the cleaned tracks show the main traffic routes and the anchorages, and they show different habits by type of ship: fishing vessels fan out between ports and the open sea, passenger ships follow fixed lines, and cargo ships spread over wide routes. For time, two ships entering the harbor on 25 January 2015 had recorded times near the harbor that were more than two hours and more than one hour later than their announced arrival times, because the messages reached the receivers late. After the correction, their arrival times came closer to the announced ones.

Limits, and what it means

The authors are open about the limits. The method cannot repair the static and voyage information, because it depends on the people who enter it, and messages whose receiving time is earlier than their generated time were not studied. The thresholds, such as 15 knots, 10 minutes and 100 points, were set empirically, and the study covers one region over two months, with data from shore stations and not from satellites. Still, the message for anyone who builds models on AIS data is clear: arrival time predictions, traffic maps and risk analyses all rest on the quality of the tracks, and a systematic cleaning step removes less than two percent of the points while taking out the errors that mislead.
A model is only as good as the tracks it learns from. Before predicting arrival times or mapping traffic, it is worth asking how the AIS data was checked for invalid messages, for illogical tracks and for time errors.
References

Recent Posts

Machine Learning for Ship Detection in Satellite Images
Oct 25th 2026
Radar sees ships through cloud and night. Correcting labels lifted optical ship recognition from 0.66-0.70 to about 0.80 mAP, more than a newer model did.
Why Ships Go Missing from Satellite AIS
Aug 14th 2026
Satellite AIS loses ships to message collisions, late data and gaps between passes. Six studies show how much is missed and how analysts work around it.
Orbit Propagation: Which Perturbations Matter
Jun 4th 2026
Across 320 propagator setups, gravity fields beyond 32 by 32 added no accuracy, while drag, the Sun and Moon, and sunlight pressure matter in different orbits.