Research Article

Vessel Trajectory Deviation Detection Using a Temporal-Attention LSTM Autoencoder

Kehao Bao*
Sun Yat-sen University

* Corresponding author: [email protected]

Abstract

Abnormal vessel trajectories are critical indicators of potential collision risks, illegal navigation behaviors, and unexpected route deviations. This study uses labelled Automatic Identification System (AIS) trajectories from Danish waters to examine a Long Short-Term Memory (LSTM) autoencoder with temporal attention for vessel trajectory deviation detection. Latitude, longitude, speed, and course are processed as fixed-length sequences, and the model is trained only with normal trajectories. Reconstruction error is then used as the anomaly score. The model is compared with Isolation Forest, a dense autoencoder, a basic LSTM autoencoder, and a position-only LSTM model under the same Maritime Mobile Service Identity (MMSI)-based data split. Multi-seed repeated experiments over five independent runs show that the attention LSTM obtains a mean receiver operating characteristic area under the curve (ROC-AUC) of 0.859, recall of 0.725, and F1-score of 0.724. The improvement over the basic LSTM is small, while the dense autoencoder gives a slightly higher average precision. The results also show that speed and course are important for detecting abnormal movement. A sequence length and hidden size of 32, together with the 95th-percentile threshold, give the most balanced results. The dataset contains few abnormal samples, so further testing on larger datasets and different sea areas is still needed.

Keywords: vessel trajectory anomaly detection; automatic identification system; LSTM autoencoder; temporal attention; maritime safety
Published: September 29, 2026
DOI: 10.54254/2755-2721/2026.37375
Volume: ACE Vol.272
pp. 25-37
Download PDF

References

  1. United Nations Conference on Trade and Development. (2024).Review of maritime transport 2024. United Nations.
  2. International Maritime Organization. (n.d.). AIS transponders.International Maritime Organization. https://www.imo.org/en/ourwork/safety/pages/ais.aspx
  3. 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.
  4. Ribeiro, C. V., Paes, A., & de Oliveira, D. (2023). AIS-based maritime anomaly traffic detection: A review.Expert Systems with Applications, 231, 120561.
  5. Sakurada, M., & Yairi, T. (2014). Anomaly detection using autoencoders with nonlinear dimensionality reduction. InProceedings of the MLSDA 2014 2nd Workshop on Machine Learning for Sensory Data Analysis(pp. 4–11).
  6. Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory.Neural Computation, 9(8), 1735–1780.
  7. Venskus, J., Treigys, P., & Markevičiūtė, J. (2021). Unsupervised marine vessel trajectory prediction using LSTM network and wild bootstrapping techniques.Nonlinear Analysis: Modelling and Control, 26(4), 718–737. https://doi.org/10.15388/namc.2021.26.23056
  8. Olesen, K. V., Boubekki, A., Kampffmeyer, M. C., Jenssen, R., Christensen, A. N., Hørlück, S., & Clemmensen, L. H. (2023). A contextually supported abnormality detector for maritime trajectories.Journal of Marine Science and Engineering, 11(11), 2085. https://doi.org/10.3390/jmse11112085
  9. Olesen, K., Christensen, A. N., & Clemmensen, L. K. H. (2023). AIS trajectories from Danish waters for abnormal behavior detection [Data set]. Technical University of Denmark. https://doi.org/10.11583/DTU.c.6287841.v1
  10. Zhao, L., & Shi, G. (2019). Maritime anomaly detection using density-based clustering and recurrent neural network.The Journal of Navigation, 72(4), 894–916.
  11. Liang, M., Weng, L., Gao, R., Li, Y., & Du, L. (2024). Unsupervised maritime anomaly detection for intelligent situational awareness using AIS data.Knowledge-Based Systems, 284, 111313.
  12. Liu, F. T., Ting, K. M., & Zhou, Z.-H. (2008). Isolation forest. InProceedings of the 2008 IEEE International Conference on Data Mining(pp. 413–422).
  13. Zhang, B., Hirayama, K., Ren, H., Wang, D., & Li, H. (2023). Ship anomalous behavior detection using clustering and deep recurrent neural network.Journal of Marine Science and Engineering, 11(4), 763.
  14. Li, H., Jiao, H., & Yang, Z. (2023). Ship trajectory prediction based on machine learning and deep learning: A systematic review and methods analysis.Engineering Applications of Artificial Intelligence, 126, 107062.
  15. Gers, F. A., Schmidhuber, J., & Cummins, F. (2000). Learning to forget: Continual prediction with LSTM.Neural Computation, 12(10), 2451–2471. https://doi.org/10.1162/089976600300015015