Loitering, waiting and anchorage are different states
In brief
- Low speed, repeated turning and spatial redundancy can occur during loitering, anchorage and ordinary operational waiting.
- A detector can reproduce a behavioural definition accurately without establishing that the definition corresponds to the vessel's underlying operational state.
- Anchorage, waiting, drifting, encounter and loitering are treated as competing explanations for the same observed trajectory, with context and uncertainty retained explicitly.
Low speed is not loitering, neither is repeated turning, remaining inside a small area or following an inefficient-looking trajectory. These are observations of vessel motion, the modelling problem is to determine which operational state best explains them. A vessel waiting for a berth, drifting while waiting for instructions, swinging around an anchor or deliberately remaining in an area can produce remarkably similar AIS trajectories.
The first question is therefore: What do we mean by loitering, and how is it different from the ordinary states that generate similar motion?
Different definitions detect different behaviours
The AIS literature makes this ambiguity visible because different studies operationalise loitering in different ways. Miller et al. identify offshore loitering by combining low speed, duration and distance from shore (Miller et al., 2018). Their single-vessel definition uses speeds below 2 knots for at least 8 hours, while explicitly recognising that refrigerated cargo vessels may remain at sea while waiting for their next job. Their sensitivity analysis also shows that detected loitering hours depend strongly on the selected speed threshold.
Zhang et al. approach the problem differently, they define loitering around frequent turning within a limited spatial range and introduce trajectory redundancy to characterise repeated local movement (Zhang et al., 2022). Their CNN then classifies characteristic trajectory shapes.
Wijaya and Nakamura construct a spatiotemporal score from speed, course change, heading/COG discrepancy, travelled distance and spatial range (Wijaya and Nakamura, 2023). Their method achieved 97% accuracy and a 92% F-score on a labelled set of 137 vessel trajectories.
These are all useful formulations, but they do not define exactly the same state. One emphasises prolonged offshore low-speed activity, another emphasises repeated turning and trajectory shape, another combines several motion characteristics into an anomaly score. The resulting labels should therefore be interpreted as operational definitions of loitering, not interchangeable measurements of a single directly observed behaviour.
Waiting is the adversarial negative class
It is waiting, A vessel waiting for a berth may move slowly outside an anchorage, a vessel awaiting orders may drift offshore. An anchored vessel may swing repeatedly with wind and current, a vessel holding position because of traffic restrictions may describe loops or repeated local movements. All can satisfy parts of a loitering definition.
This is why the synthetic testbed deliberately contains true loitering episodes alongside:
- vessels waiting at anchor;
- vessels drifting while waiting;
- vessels waiting offshore for instructions;
- local manoeuvring;
- ordinary transit.
The purpose is to that methods should be evaluated against the problem it was designed to solve, mainly stress testing: can a detector distinguish anomalous local persistence from ordinary operational reasons for remaining in the same area?
An illustrative synthetic run makes the ambiguity visible, even after removing known anchored tracks, a spatiotemporal loitering score can rank drifting and order-waiting vessels highly because their speed, course-change and displacement patterns resemble the target motion. It is a demonstration that waiting is a structurally plausible alternative explanation rather than an edge case.
Missingness is also behaviourally relevant
AIS gaps introduce another layer of ambiguity. A simple preprocessing pipeline may drop a trajectory when the interval between messages exceeds a fixed threshold. That can be reasonable for maintaining trajectory continuity, but it becomes problematic if missingness itself is relevant to the downstream task.
A vessel that disappears during an otherwise unusual episode should not automatically vanish from the analysis. It does not mean every AIS gap is suspicious; coverage, reception conditions, equipment and transmission schedules all affect missingness. It means that observation quality should be part of the model rather than silently converted into a behavioural assumption.
A competing state-space formulation
An ideal scenario represents the problem as a shared state space rather than a collection of unrelated binary detectors.
Estimation model would look like:
P(state_t | AIS history, vessel context, geographic context, nearby traffic, observation quality).
The state set could include:
{transit, manoeuvring, anchorage, waiting/drift, encounter, loitering, unresolved}.
The important addition is unresolved. AIS does not always contain enough evidence to infer operational intent. A useful system should be allowed to preserve that uncertainty rather than forcing every trajectory into a semantic category.
Loitering should be a residual explanation
Rather than treating loitering as any trajectory with sufficient turning, redundancy or low-speed persistence, an ideal formulation treats it as a residual behavioural hypothesis:
persistent local motion that is difficult to explain through expected transit, manoeuvring, anchorage, operational waiting or another recognised vessel state.
A vessel may loiter because of weather, mechanical problems, operational instructions, safety concerns or activities that require further investigation. The detector’s role is therefore not to decide why the vessel is loitering, rather it is to establish that the observed behaviour is insufficiently explained by the ordinary alternatives represented in the model.
That distinction is particularly important for maritime surveillance, where unusual behaviour is not equivalent to illicit behaviour.
Why label construction matters
A supervised classifier learns the taxonomy encoded in its training labels. If a dataset defines loitering using a speed threshold, the trained model is primarily learning to reproduce that operational definition. If experts label trajectories according to shape and context, the classifier learns that expert-derived taxonomy.
High classification accuracy can therefore mean, the model reproduces the labels consistently without necessarily meaning: the labels identify the vessel’s true operational intent.
This distinction becomes clear in recent anomaly-classification work. Liu et al. classify kinematic anomalies into speed/course anomaly, turning anomaly and loitering anomaly (Liu et al., 2024). Their speed/course and turning labels are produced through tailored detection rules, while loitering trajectories undergo preliminary screening followed by manual assessment and annotation. They report very high classification performance once these labelled categories are established.
That is useful evidence that the kinematic taxonomy is learnable, it does not remove the separate question of whether two geometrically similar trajectories correspond to loitering, waiting or another operational state.
For higher-confidence behavioural labels, an ideal pipeline introduces an independent evidence path using, where available:
- port-call and berth records;
- known anchorages and holding areas;
- vessel schedules or operational logs;
- nearby-vessel interactions;
- reviewed vessel histories;
- radar or satellite imagery;
- other contextual evidence.
These sources need not provide perfect ground truth, their value is that they do not derive the behavioural label entirely from the same trajectory features being evaluated.
From anomaly score to competing explanations
The detector should therefore return more than a single anomaly score, which can be formalised as:
P(state_t ∈ {anchorage, waiting/drift, encounter, loitering, transit, unresolved} | history, context, observation quality).
A high loitering probability becomes meaningful only relative to the alternatives.
The system should be able to say, conceptually: The trajectory exhibits persistent local motion. Anchorage is unlikely because the vessel is outside known anchorage areas and its displacement pattern is inconsistent with bounded swing. Operational waiting remains plausible but is weakly supported by nearby traffic and port context. Loitering therefore remains the highest-probability explanation, with substantial uncertainty.
That is more useful than loitering score = 0.87, it also makes the inference inspectable.
Evaluation
Ping-level classification accuracy is not sufficient, it can evaluated at four levels.
State discrimination
- anchorage versus waiting/drift;
- waiting versus loitering;
- encounter versus independent local motion;
- unresolved cases rather than forced classifications.
Event reconstruction
- event precision and recall;
- start/end boundary error;
- duration error;
- fragmented and merged episodes.
Calibration and uncertainty
- Brier score or equivalent probabilistic metric;
- reliability of state probabilities;
- abstention performance on ambiguous trajectories;
- sensitivity to missing AIS observations.
Generalisation
- vessel-held-out performance;
- port- and region-held-out performance;
- performance across traffic densities;
- sensitivity to changes in AIS sampling frequency;
- performance around unseen holding areas and anchorage geometries.
A particularly important stress test is to hold the underlying operational state constant while changing its spatial expression. If the same waiting behaviour is moved from a charted anchorage to an offshore holding area, the state estimate should not become anomalous merely because the geography changed.
Research direction
The next problem is is waiting-aware behavioural inference.
A practical pipeline would:
- reconstruct slow-motion and local-persistence episodes;
- infer anchorage, waiting/drift, encounter, loitering or unresolved state;
- incorporate vessel, port and nearby-traffic context;
- model observation quality and AIS gaps explicitly;
- retain calibrated uncertainty;
- evaluate events rather than individual messages;
- test across ports, vessel classes and traffic regimes.
The central distinction is the same one that appears throughout maritime behaviour modelling: motion ≠ state
AIS tells us how a vessel moved, the harder and more useful problem is determining which operational state best explains that movement.
References
- Miller, N. A. et al. (2018). Identifying Global Patterns of Transshipment Behavior. Frontiers in Marine Science, 5, 240.
- Zhang, W. et al. (2022). Loitering behavior detection and classification of vessel movements based on trajectory shape and Convolutional Neural Networks. Ocean Engineering, 258, 111852.
- Wijaya, A. and Nakamura, T. (2023). Loitering behavior detection by spatiotemporal characteristics quantification based on the dynamic features of AIS messages. PeerJ Computer Science, 9, e1572.
- Liu, R., Li, H. and Liu, Y. (2024). AIS-based kinematic anomaly classification for maritime surveillance. Ocean Engineering, 308, 118026.