# Ship AIS Trajectory Clustering: An HDBSCAN-Based Approach

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Methodology

#### 2.1. Methodological Overview of the Research

#### 2.2. Ship Trajectory Data Preprocessing

#### 2.3. Hausdorff-Based Similarity Measures

#### 2.4. HDBSCAN

## 3. Model Design

#### 3.1. Definition of Ship Trajectory

#### 3.2. Trajectory Data Preprocessing

#### 3.3. Similarity Measures

#### 3.3.1. Hausdorff Distance

#### 3.3.2. A Similarity Function with Adaptive Scale Parameters

#### 3.4. Ship Trajectory Clustering with HDBSCAN

**Core distance**: the distance between the sample point and the ${K}_{th}$ nearest sample point; and (2)

**mutual reachability distance**: the value is the maximum value of the core distance of two sample points and the distance between two sample points. The mutual reachability distance can be obtained with Equation (4):

#### 3.5. Clustering Performance Metrics

#### 3.6. Design of the Algorithm

## 4. Case Study

#### 4.1. Data Processing and Similarity Measurement

#### 4.2. Hierarchical Density-Based Spatial Clustering

#### 4.3. Adaptive Determination of Clustering Numbers

## 5. Discussion

#### 5.1. Comparison with Other Clustering Algorithm

#### 5.2. Analysis of the Clustering Results

#### 5.3. Parameter Selection and Sensitivity Analysis

## 6. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Mou, J.M.; van der Tak, C.; Ligteringen, H. Study on collision avoidance in busy waterways by using AIS data. Ocean Eng.
**2010**, 37, 483–490. [Google Scholar] [CrossRef] - Chen, P.F.; Huang, Y.M.; Mou, J.M.; van Gelder, P.H.A.J.M. Probabilistic risk analysis for ship-ship collision: State-of-the-art. Saf. Sci.
**2019**, 117, 108–122. [Google Scholar] [CrossRef] - Chen, P.F.; Huang, Y.M.; Papadimitriou, E.; Mou, J.M.; van Gelder, P. Global path planning for autonomous ship: A hybrid approach of Fast Marching Square and velocity obstacles methods. Ocean Eng.
**2020**, 214. [Google Scholar] [CrossRef] - Jain, A.K. Data clustering: 50 years beyond K-means. Pattern Recognit. Lett.
**2010**, 31, 651–666. [Google Scholar] [CrossRef] - Zhao, L.B.; Shi, G.Y. A trajectory clustering method based on Douglas-Peucker compression and density for marine traffic pattern recognition. Ocean Eng.
**2019**, 172, 456–467. [Google Scholar] [CrossRef] - Grifoll, M.; Karlis, T.; Ortego, M.I. Characterizing the Evolution of the Container Traffic Share in the Mediterranean Sea Using Hierarchical Clustering. J. Mar. Sci. Eng.
**2018**, 6, 121. [Google Scholar] [CrossRef] [Green Version] - Malagon Santos, V.; Haigh, I.; Wahl, T. Spatial and Temporal Clustering Analysis of Extreme Wave Events around the UK Coastline. J. Mar. Sci. Eng.
**2017**, 5, 28. [Google Scholar] [CrossRef] [Green Version] - Yang, D.; Wu, L.; Wang, S.; Jia, H.; Li, K.X. How big data enriches maritime research—A critical review of Automatic Identification System (AIS) data applications. Transp. Rev.
**2019**, 39, 755–773. [Google Scholar] [CrossRef] - Liu, D.P.; Wang, X.; Cai, Y.; Liu, Z.H.; Liu, Z.J. A Novel Framework of Real-Time Regional Collision Risk Prediction Based on the RNN Approach. J. Mar. Sci. Eng.
**2020**, 8, 224. [Google Scholar] [CrossRef] [Green Version] - Yuan, G.; Sun, P.; Zhao, J.; Li, D.; Wang, C. A review of moving object trajectory clustering algorithms. Artif. Intell. Rev.
**2016**, 47, 123–144. [Google Scholar] [CrossRef] - Wang, X.; Bai, Y. The global Minmax k-means algorithm. Springerplus
**2016**, 5, 1665. [Google Scholar] [CrossRef] [Green Version] - Tyagi, L.; Trivedi, M.C. Hybrid K-Mean and Refinement Based on Ant for Color Image Clustering. In Proceedings of the International Conference on ICT for Sustainable Development, Amsterdam, The Netherlands, 29 August–1 September 2016. [Google Scholar]
- Roiha, N.U.; Suprapto, Y.K.; Wibawa, A.D. The optimization of the weblog central cluster using the genetic K-means algorithm. In Proceedings of the Technology of Information & Communication, Moscow, Russia, 20–22 September 2017. [Google Scholar]
- Jiang, Y.; Li, B.; Zhang, H.; Luo, Q.; Zhou, P. A Novel Classification Scheme of Moving Targets at Sea Based on Ward’s and K-means Clustering. In Proceedings of the 2nd International Conference on Computer Science and Application Engineering (CSAE 2018) Hohhot, Hohhot, China, 22–24 October 2018; pp. 1–5. [Google Scholar]
- Ma, W.; Wu, Z.; Yang, J.; Li, W. Vessel Motion Pattern Recognition Based on One-Way Distance and Spectral Clustering Algorithm. In Proceedings of the International Conference on Algorithms & Architectures for Parallel Processing, Dalian, China, 24–27 August 2014. [Google Scholar]
- Nataliani, Y.; Yang, M.-S. Powered Gaussian kernel spectral clustering. Neural Comput. Appl.
**2017**, 31, 557–572. [Google Scholar] [CrossRef] - Gao, M.; Shi, G.Y. Ship-handling behavior pattern recognition using AIS sub-trajectory clustering analysis based on the T-SNE and spectral clustering algorithms. Ocean Eng.
**2020**, 205. [Google Scholar] [CrossRef] - Zhao, L.; Shi, G.; Yang, J. An adaptive hierarchical clustering method for ship trajectory data based on DBSCAN algorithm. In Proceedings of the IEEE International Conference on Big Data Analysis, Boston, MA, USA, 11–14 December 2017. [Google Scholar]
- Zhao, L.B.; Shi, G.Y. Maritime Anomaly Detection using Density-based Clustering and Recurrent Neural Network. J. Navig.
**2019**, 72, 894–916. [Google Scholar] [CrossRef] - Campello, R.; Moulavi, D.; Sander, J. Density-based clustering based on hierarchical density estimates. In Proceedings of the Pacific-Asia Conference on Knowledge Discovery and Data Mining, Gold Coast, Australia, 14–17 April 2013. [Google Scholar]
- Zhang, D.Z.; Lee, K.; Lee, I. Hierarchical trajectory clustering for spatio-temporal periodic pattern mining. Expert Syst. Appl.
**2018**, 92, 1–11. [Google Scholar] [CrossRef] - Ghamarian, I.; Marquis, E.A. Hierarchical density-based cluster analysis framework for atom probe tomography data. Ultramicroscopy
**2019**, 200, 28–38. [Google Scholar] [CrossRef] [PubMed] - Lentzakis, A.F.; Seshadri, R.; Akkinepally, A.; Vu, V.A.; Ben-Akiva, M. Hierarchical density-based clustering methods for tolling zone definition and their impact on distance-based toll optimization. Transp. Res. Part C Emerg. Technol.
**2020**, 118. [Google Scholar] [CrossRef] - Ibrahim, R.; Shafiq, M.O. Mining Trajectory Data and Identifying Patterns for Taxi Movement Trips. In Proceedings of the 2018 Thirteenth International Conference on Digital Information Management (ICDIM), Berlin, Germany, 24–26 September 2018; pp. 130–135. [Google Scholar]
- Wilson, A.T.; Rintoul, M.D.; Valicka, C.G. Exploratory Trajectory Clustering with Distance Geometry. Found. Augment. Cogn. Neuroergon. Oper. Neurosci.
**2016**, 9744, 263–274. [Google Scholar] [CrossRef] - Wang, Z.H.; Hu, J.K.; Fan, Q.Q. Extracting the Main Routes and Speed Profiles Between Two Locations from Massive Uncertain Historical Trajectories. In Proceedings of the 2018 International Symposium in Sensing and Instrumentation in IoT Era (ISSI), Shanghai, China, 6–7 September 2018. [Google Scholar]
- Mou, J.; Chen, P.; Yixiong, H.E.; Zhang, X.; Zhu, J.; Rong, H. Fast self-tuning spectral clustering algorithm for AIS ship trajectory. J. Harbin Eng. Univ.
**2018**, 39, 428–432. [Google Scholar] - Visvalingam, M.; Whyatt, J.D. The Douglas-Peucker Algorithm for Line Simplification: Re-evaluation through Visualization. Comput. Graph. Forum
**1990**, 9, 213–225. [Google Scholar] [CrossRef] - Rousseeuw, P.J. Silhouettes: A graphical aid to the interpretation and validation of cluster analysis. J. Comput. Appl. Math.
**1987**, 20, 53–65. [Google Scholar] [CrossRef] [Green Version] - Davies, D.L.; Bouldin, D.W. A cluster separation measure. IEEE Trans. Pattern Anal. Mach. Intell.
**1979**, 1, 224–227. [Google Scholar] [CrossRef] [PubMed]

**Figure 8.**Illustration of clusters obtained with the proposed method (rows are labelled with numeric value and column is labelled with alphabets).

**Figure 13.**Results of Re-clustering of Figure 8(2a) based on HDBSCAN.

**Figure 14.**Results of Re-clustering of Figure 8(2b) based on HDBSCAN.

Item | Configuration |
---|---|

Boundary | Latitude: 30.8869° N to 31.2915° N; Longitude: 121.6321° E to 122.7477° E |

The number of research ship trajectories | 791 |

Trajectory data sources | Yangtze River Estuary, China on 1 May 2019, provided by Wuhan University of Technology |

Nr. | 1 | 2 | 3 | … | 708 | 709 | 710 |
---|---|---|---|---|---|---|---|

1 | 1 | 0.4320 | 0.2169 | … | 0.9393 | 0.9427 | 0.9190 |

2 | 0.4320 | 1 | 0.9302 | … | 0.2926 | 0.3319 | 0.2930 |

3 | 0.2169 | 0.9302 | 1 | … | 0.1194 | 0.1498 | 0.1204 |

… | … | ||||||

708 | 0.9393 | 0.2926 | 0.1194 | … | 1 | 0.9926 | 0.9556 |

709 | 0.9427 | 0.3319 | 0.1498 | … | 0.9926 | 1 | 0.9234 |

710 | 0.9190 | 0.2930 | 0.1204 | … | 0.9556 | 0.9234 | 1 |

No. | Algorithm | Description |
---|---|---|

1 | K-means | A distance-based clustering algorithm that combines simplicity and classics |

2 | spectral clustering | The algorithm evolved from graph theory has stronger adaptability to data distribution and less computation |

3 | DBSCAN | The classic density-based clustering algorithm can find clusters of arbitrary shape in noisy spatial database |

4 | HDBSCAN | A new clustering method combining density clustering and analytic hierarchy process |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Wang, L.; Chen, P.; Chen, L.; Mou, J.
Ship AIS Trajectory Clustering: An HDBSCAN-Based Approach. *J. Mar. Sci. Eng.* **2021**, *9*, 566.
https://doi.org/10.3390/jmse9060566

**AMA Style**

Wang L, Chen P, Chen L, Mou J.
Ship AIS Trajectory Clustering: An HDBSCAN-Based Approach. *Journal of Marine Science and Engineering*. 2021; 9(6):566.
https://doi.org/10.3390/jmse9060566

**Chicago/Turabian Style**

Wang, Lianhui, Pengfei Chen, Linying Chen, and Junmin Mou.
2021. "Ship AIS Trajectory Clustering: An HDBSCAN-Based Approach" *Journal of Marine Science and Engineering* 9, no. 6: 566.
https://doi.org/10.3390/jmse9060566