Port water area adaptive identification method fusing bayesian optimization and density clustering
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DALIAN UNIV OF TECH
- Filing Date
- 2026-06-09
- Publication Date
- 2026-08-07
AI Technical Summary
[0004](1)依赖静态海图数据:现有研究大多基于航海用电子海图获取泊位与锚地信息,但海图存在更新滞后、无法反映船舶动态行为等问题
本发明提供的融合贝叶斯优化与密度聚类的港口水域自适应识别方法,采用基于六维综合评分的贝叶斯优化方法,自适应确定DBSCAN的最优邻域半径和最小样本数
,结合多级数据预处理(数据清洗、低速点筛选、异常船舶识别与剔除、航次分割),从海量AIS数据中高效、准确地提取船舶停泊点,有效去除航行动态点与异常噪声。以方向感知DBI(Davies Bouldin Index)为优化目标,采用贝叶斯优化自适应确定空间距离系数
、密度系数
和最小停靠次数阈值
,执行改进的IMA DBSCAN自适应迭代聚类,动态更新空间距离阈值与最小样本数,并结合航向角度差进行时空邻域判断;通过多层次后处理(基于时间信息的泊位合并、基于海岸线数据的误识别泊位删除、锚地二次聚类及异常移除),精准区分泊位簇与锚地簇。相较于传统固定参数聚类方法,本发明实现了聚类参数的全自动自适应确定,能够适应不同港口的地理特征、泊位布局与AIS数据密度分布,显著提升泊位与锚地识别的精度与鲁棒性。同时,引入基于真实集装箱泊位基准数据与网格密度聚类的双重校验评估体系,确保了识别结果的可靠性。从实验效果来看,本发明在多个港口均取得了优异的识别性能,泊位识别精确率达到100%,召回率达到100%,锚地识别精确率达到100%,验证了方法的有效性与实用性。
Smart Images

Figure CN122364789B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of big data analytics, and in particular to an adaptive identification method for port waterways that integrates Bayesian optimization and density clustering. Background Technology
[0002] Ports, as international cargo distribution and transshipment centers, are key nodes in the global supply chain. Efficient port operations are crucial for ensuring smooth transoceanic supply chains and supporting global trade flows. In recent years, with the rapid development of satellite remote sensing and Automatic Identification System (AIS) technologies, dynamic monitoring of port performance based on AIS big data has become a research hotspot. By deeply mining the AIS data accumulated in daily operations, it is possible to analyze ship behavior in port more precisely, thereby assessing port operational efficiency and congestion levels.
[0003] Accurate identification of berths and anchorages within a port is fundamental for refined port analysis. Specifically, vessel waiting times at anchorages can quantify port congestion, while vessel operating time at berths can be used to calculate port throughput and operational efficiency. However, existing methods for identifying berths and anchorages suffer from the following main problems:
[0004] (1) Reliance on static nautical chart data: Most existing studies rely on electronic nautical charts to obtain berth and anchorage information, but nautical charts have problems such as delayed updates and inability to reflect the dynamic behavior of ships. With the rapid growth of global maritime trade, newly built or expanded terminals often cannot be reflected in nautical charts in a timely manner, resulting in discrepancies between the identification results and the actual situation.
[0005] (2) Fixed parameters in single clustering algorithms: Some studies have attempted to use the DBSCAN equal-density clustering algorithm to identify port areas from AIS data, but traditional clustering algorithms have inherent defects such as parameter settings relying on human experience and sensitivity to input parameters. Different ports have significant differences in berth layout, channel conditions, and ship berthing patterns, and fixed parameter settings are difficult to adapt to the diverse geographical characteristics of ports around the world.
[0006] (3) Difficulty in distinguishing between berths and anchorages. Existing methods mostly identify the entire port area as a whole, failing to effectively distinguish between berths and anchorages. In fact, berth areas have high vessel density and regular course, while anchorage areas have relatively low vessel density and irregular course. The two have different spatial distribution and motion characteristics, requiring the design of specialized algorithms to distinguish them.
[0007] (4) Lack of systematic verification and evaluation: Existing research relies heavily on manual visual interpretation to verify clustering results, lacking a quantitative evaluation system based on real labeled data, making it difficult to objectively measure the recognition accuracy and generalization ability of the algorithm.
[0008] To address the aforementioned issues, the paper "A Data-Driven Iterative Multi-Attribute Clustering Algorithm and Its Application in Port Congestion Estimation" proposes an iterative multi-attribute DBSCAN algorithm. By incorporating heading information and time overlap judgment, this algorithm achieves a certain degree of differentiation between berths and anchorages. However, this method still uses fixed values for parameter settings (such as...). =0.5, =0.08), making it difficult to adapt to the geographical characteristics and data distribution of different ports.
[0009] In summary, there is a need for an algorithm that can adaptively and automatically identify berths and anchorages with high precision, adapt to different port characteristics, and systematically verify and evaluate the identification results by combining real berth benchmark datasets, so as to provide a reliable data foundation for port congestion analysis and ship behavior perception. Summary of the Invention
[0010] To address the aforementioned technical problems, this invention provides an adaptive identification method for port waterways that integrates Bayesian optimization and density clustering. This invention primarily utilizes AIS trajectory data to study a data-driven adaptive identification method for port berths and anchorages, accurately identifying the geographical boundaries of berths and anchorages for each port.
[0011] The technical means employed in this invention are as follows: An adaptive identification method for port waterways integrating Bayesian optimization and density clustering includes: acquiring raw AIS data of the target port, filtering container ship data, spatially cropping it based on geographical latitude and longitude range to obtain a container ship AIS dataset within the port, and constructing a container berth benchmark dataset; performing multi-level data preprocessing on the container ship AIS dataset within the port; denoising the preprocessed container ship AIS data within the port using intra-voyage DBSCAN clustering based on Bayesian optimization to obtain a ship berthing point dataset; constructing a waterway identification model and adaptively determining the optimal parameter combination using a Bayesian optimization method; performing adaptive iterative clustering based on the optimal parameter combination to aggregate berthing points into multiple candidate clusters; performing multi-level post-processing on the results of the adaptive iterative clustering to obtain berth clusters and anchorage clusters; verifying and evaluating the berth clusters using the container berth benchmark dataset to determine the berth waterways of the port; and verifying the anchorage clusters using a spatial analysis method based on grid density to determine the anchorages of the port, thereby achieving the identification of container operation waterways.
[0012] Furthermore, the container ship data is filtered based on the port code at the end of the voyage. The port code at the end of the voyage is a five-letter port code. The trajectory of container ships belonging to the target port is extracted from the original AIS data through a preset list of target port five-letter codes. The geographical latitude and longitude range is set according to the actual water boundary of the target port. The construction of the container berth benchmark dataset is carried out by overlaying and analyzing online nautical charts, high-resolution satellite imagery, and historical AIS ship trajectories to determine the location of container berths and the orientation of the shoreline, forming berth benchmark data for accuracy verification.
[0013] Furthermore, the multi-level data preprocessing includes data cleaning, low-speed point screening, abnormal vessel identification and removal, and voyage segmentation; the data cleaning retains vessel MMSI codes, timestamps, and ground speeds through screening. Latitude and longitude coordinates, heading towards the ground Remove null records from the port code and vessel operation status fields at the end of the voyage; set the ground speed... Records exceeding the first ground speed threshold are judged as speed anomalies and are removed; based on the continuity of ship motion, the spatial distance and time interval between adjacent records are calculated to estimate the average speed, and records whose estimated speed exceeds the threshold are judged as position anomalies and are removed. The low-speed point screening is achieved by checking the ground speed. AIS records below the second ground speed threshold are identified as anchorage points and retained, while other navigation data are discarded. The abnormal vessel identification and removal process involves identifying and removing vessels with fewer than the first berthing record threshold as having unreliable data, and removing vessels with more than the second berthing record threshold as having been idle for a long time or with equipment failure. The voyage segmentation is achieved by arranging the AIS records of the same vessel in ascending order of time and calculating the time difference between adjacent records. ,like Hours are considered as one port call, if Each hour is considered as two independent port calls, resulting in data tagged with voyage number.
[0014] Furthermore, the Bayesian-optimized intra-flight DBSCAN clustering denoising uses a comprehensive score as the objective function. This comprehensive score is calculated by weighting data retention rate, cohesion, separation, noise removal accuracy, intra-cluster dispersion, and inter-cluster distance. The calculation formula is as follows:
[0015] in, For data retention rate, For cohesion, For resolution, For noise removal accuracy, Intra-cluster dispersion Inter-cluster distance; The data retention rate is used to measure the proportion of effective data retained after denoising, and the calculation formula is:
[0016] in, Number of noise points Total points for the voyage; The cohesion is used to measure the density of data points within the same cluster, reflecting the spatial accuracy of berth identification. The scoring rules are as follows:
[0017] in, Indicates the degree of cohesion. The overall cohesion is obtained by averaging the scores of all clusters based on the average distance from each point to other points in the same cluster. The separation degree is used to measure the degree of distinction between different clusters, reflecting the clarity of the berth boundary. The scoring rules are as follows:
[0018] in, Indicates the degree of separation. The minimum distance from a sample point to its nearest neighbor cluster is 100 meters, which is the baseline value for a reasonable distance between berths; the overall separation is obtained by averaging the scores of all sample points. The noise removal accuracy is used to measure the degree of isolation of points marked as noise, reflecting the accuracy of noise removal, and is scored using a piecewise function; The intra-cluster dispersion is evaluated using the maximum intra-cluster distance to assess the cluster's compactness, reflecting the spatial span of the berth. The scoring formula is as follows:
[0019] in, Indicates intra-cluster dispersion. The maximum distance between any two points within a cluster is given by 200 meters, which is the baseline value for the length of a typical wharf. The average value of all cluster scores is used to obtain the overall cluster dispersion. The inter-cluster distance is used to measure the minimum distance between nearest neighbor clusters, reflecting the degree of spatial separation between different berths. The scoring rules are as follows:
[0020] in, Indicates the inter-cluster distance. The minimum point-to-point distance between different clusters is 50 meters, which is the baseline value for the minimum safe distance. The average distance between all clusters is used to obtain the overall inter-cluster distance.
[0021] Furthermore, the optimal value of the parameter combination is determined using the Bayesian optimization method, the parameter combination including spatial distance coefficients. Density coefficient and minimum number of stops threshold ; Transition score of direction-aware DBI The objective function is:
[0022] in, Direction-aware DBI; Define spatial distance coefficients respectively Density coefficient and minimum number of stops threshold The search space is defined, and a tree-structured Palzen estimator (TPE) is used as a probabilistic surrogate model to initialize a Gaussian process or TPE model. Random sampling is performed within the parameter search space to generate an initial set of parameter combinations. A clustering algorithm is run on each set of parameters to calculate the corresponding parameters. Update the surrogate model; select the next set of parameters to be evaluated based on the expected improvement of the acquisition function, run clustering and evaluate, and update the model; repeat the model update until the preset number of iterations is reached, and output the parameter combination that maximizes the objective function as the optimal one. , and value.
[0023] Furthermore, the adaptive iterative clustering is used to assess spatial distance. and minimum sample size Dynamic updates:
[0024]
[0025] in, This is the spatial distance coefficient. Density coefficient This represents the average distance from all non-noise points to their respective cluster centroids in the current iteration. The total number of samples, The number of noise samples. This represents the number of clusters in the current iteration. This represents the average number of sample points per cluster, reflecting the average size of the clusters in the current clustering results; The function is the floor function; the termination condition of the adaptive iterative clustering is the current iteration's floor function. Compared with the previous iteration The difference is less than the preset threshold .
[0026] Furthermore, the multi-level post-processing includes: berth merging based on time information, deletion of misidentified berths based on coastline data, anchorage identification, and anomaly removal; classifying high-density strip-shaped berths with consistent course and distributed along container berths into berth clusters; and classifying medium- and low-density circular or irregularly scattered areas formed by berths with irregular course in offshore waters into anchorage clusters. The time-based berth merging means that for any two clusters, if the centroid distance between the two clusters is less than 500 meters and the berthing time intervals of all ships do not overlap, then the two clusters will be merged into the same berth. The method for deleting misidentified berths based on coastline data involves introducing real coastline data and calculating the shortest spherical distance from the center point of the berth cluster to the nearest coastline segment. If the distance is greater than 600 meters, the berth is determined to be a misidentified berth, and the center point of the current berth cluster is removed from the berth set and added to the anchorage candidate pool. The anchorage identification process involves secondary clustering using the DBSCAN algorithm on points marked as noise and points that were mistakenly identified as berths and subsequently deleted. The non-noise points in the clustering results are then marked as anchorage areas. The term "abnormal removal" refers to counting the number of times different vessels in each berth cluster and anchorage cluster have berthed. If the number of berths is less than the minimum berth count threshold, the vessel is removed from the list. If a point is found to be an abnormal mooring point, it will be removed. Check whether the point of each anchorage cluster falls within any berth bulge; if so, it will be removed.
[0027] Furthermore, the berth cluster is verified and evaluated, specifically including: For any cluster of berths, calculate the geometric center point. Construct a collection of container berth sections. ,in For the first Container berth section; calculate center point The shortest spherical distance to the set of container berth sections Specifically, it includes: Calculate the center point Project the perpendicular line onto the berth segment and determine if the projection point lies between the endpoints of the berth segment; if the projection point lies on the segment, then the distance... The distance from the center point to the projection point; if the projection point is not on the line segment, then the distance is... Take the smaller of the distances from the center point to the two endpoints of the line segment and record the minimum distance value. If the shortest spherical distance is If the number of berth clusters is less than a preset threshold, the berth cluster is determined to be correctly identified; based on the number of correctly identified berth clusters, the precision and recall of berth identification are calculated. The method for calculating the berth identification recall rate is as follows:
[0028] in, For recall rate, The number of berth segments that are correctly associated. This represents the total number of berth sections. The correctly associated berth segment refers to a container berth segment. If at least one berth cluster exists, its center point to this berth section Shortest spherical distance If the value is less than the preset threshold, then the berth section is determined. It was correctly associated.
[0029] Furthermore, the anchorage cluster is verified and evaluated, specifically including: Using ship status labels from AIS data, records in the anchored state are selected as the basis for constructing the anchorage reference benchmark. Anchorage reference polygons are generated based on grid density clustering, specifically including: dividing the study area into regular grid cells using the Geohash coding system; counting the number of candidate mooring points within each grid cell; and constructing a density matrix. Set threshold Filter out The process involves: using high-density grid cells; eliminating isolated small-scale grid regions; identifying connected regions formed by adjacent high-density grid cells as candidate anchorage areas; and merging candidate anchorage areas with a spatial distance of less than 1.5 kilometers to generate the final anchorage reference polygon. ; The accuracy of anchorage clusters identified by the model is verified and optimized based on spatial overlay analysis, specifically including: generating convex hull polygons for each anchorage cluster. and the anchorage reference polygon The formula for calculating the ratio of the spatial intersection area of two polygons to the area of the convex hull polygon of the anchor cluster identified by the model is as follows:
[0030] If the intersection ratio If the intersection ratio is as stated, then the anchorage cluster is determined to be correctly identified; If the identification is incorrect, further analysis of the reasons for the identification deviation is required.
[0031] Compared with the prior art, the present invention has the following advantages: The port water area adaptive identification method provided by this invention integrates Bayesian optimization and density clustering. It adopts a Bayesian optimization method based on six-dimensional comprehensive scoring to adaptively determine the optimal neighborhood radius of DBSCAN. and minimum sample size By combining multi-level data preprocessing (data cleaning, low-speed point screening, abnormal vessel identification and removal, and voyage segmentation), vessel mooring points are efficiently and accurately extracted from massive AIS data, effectively removing navigation dynamic points and abnormal noise. Using direction-aware DBI (Davies Bouldin Index) as the optimization objective, Bayesian optimization is employed to adaptively determine the spatial distance coefficients. Density coefficient and minimum number of stops threshold This invention employs an improved IMA DBSCAN adaptive iterative clustering method, dynamically updating spatial distance thresholds and minimum sample size, and combining heading angle differences for spatiotemporal neighborhood determination. Through multi-level post-processing (berth merging based on time information, deletion of misidentified berths based on coastline data, secondary clustering of anchorages, and anomaly removal), it accurately distinguishes between berth and anchorage clusters. Compared to traditional fixed-parameter clustering methods, this invention achieves fully automatic adaptive determination of clustering parameters, adapting to the geographical features, berth layout, and AIS data density distribution of different ports, significantly improving the accuracy and robustness of berth and anchorage identification. Simultaneously, a dual verification and evaluation system based on real container berth benchmark data and grid density clustering is introduced to ensure the reliability of the identification results. Experimental results show that this invention achieves excellent identification performance in multiple ports, with 100% accuracy and recall for berth identification and 100% accuracy for anchorage identification, verifying the effectiveness and practicality of the method. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a framework diagram of the adaptive identification method for port waters that integrates Bayesian optimization and density clustering in this invention.
[0034] Figure 2 This is a clustering result diagram of the first port in an embodiment of the present invention.
[0035] Figure 3 This is a clustering result diagram of the second port in an embodiment of the present invention. Detailed Implementation
[0036] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0039] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0040] like Figure 1As shown, this invention provides an adaptive identification method for port waterways that integrates Bayesian optimization and density clustering. The method includes: acquiring the original AIS data of the target port, filtering container ship data, spatially cropping the data based on geographical latitude and longitude ranges to obtain an AIS dataset of container ships within the port, and constructing a reference dataset for container berths. In a preferred embodiment, the container ship data is filtered based on the port code at the end of the voyage. The port code is a five-letter port code. The trajectory of container ships belonging to the target port is extracted from the original AIS data using a preset list of target port five-letter codes. The geographical latitude and longitude range is set according to the actual waterway boundary of the target port. This is used to eliminate redundant data outside the port area, reducing the amount of data processed subsequently.
[0041] The construction of the container berth benchmark dataset involves overlaying and analyzing online nautical charts, high-resolution satellite imagery, and at least five months of historical AIS vessel tracks to determine the location of container berths and the orientation of the shoreline, thus forming berth benchmark data for accuracy verification.
[0042] Multi-level data preprocessing is performed on the AIS dataset of container ships within the port. In a preferred embodiment of this invention, the multi-level data preprocessing includes data cleaning, low-speed point screening, abnormal ship identification and removal, and voyage segmentation.
[0043] Data cleaning involves filtering and retaining the ship's MMSI code, timestamp, and ground speed. Latitude and longitude coordinates, heading towards the ground Remove null records from the port code and vessel operation status fields for the end of the voyage. Set the ground speed... Records exceeding the first ground speed threshold are considered speed anomalies and are discarded. The first ground speed threshold is 20 knots. Records with speed anomalies are discarded. Based on the continuity of ship motion, the average speed is calculated by measuring the spatial distance and time interval between adjacent records. Records with calculated speeds exceeding a threshold are discarded as position anomalies. The threshold is set to 50 knots, and records with calculated speeds exceeding 50 knots are discarded as position anomalies.
[0044] Low-speed point screening is achieved by adjusting the ground speed. AIS records below the second ground speed threshold are identified as anchorage points and retained; all other navigation data are discarded. The second ground speed threshold is 1 knot. The section's AIS record was determined to be a mooring point and retained.
[0045] Abnormal vessel identification and removal involves removing vessels with fewer than a first berthing record threshold as having unreliable data, and removing vessels with more than a second berthing record threshold as having been idle for a long time or experiencing equipment malfunction. The first berthing record threshold is 100 records, and the second berthing record threshold is 100,000 records.
[0046] Voyage segmentation involves arranging AIS records of the same vessel in ascending chronological order and calculating the time difference between adjacent records. ,like Hours are considered as one port call, if Each hour is considered as two independent port calls, resulting in data tagged with voyage number.
[0047] The preprocessed AIS data of container ships within the port is denoised using Bayesian-optimized intra-voyage DBSCAN clustering to obtain a ship berthing point dataset. Specifically, in a preferred embodiment of this invention, the Bayesian-optimized intra-voyage DBSCAN clustering denoising uses a comprehensive score as the objective function. The comprehensive score is calculated by weighting data retention rate, cohesion, separation, noise removal accuracy, intra-cluster dispersion, and inter-cluster distance. The calculation formula is as follows:
[0048] in, For data retention rate, For cohesion, For resolution, For noise removal accuracy, Intra-cluster dispersion This represents the inter-cluster distance. The overall score ranges from [0,1], with higher scores indicating better clustering performance.
[0049] Data retention rate measures the proportion of valid data retained after denoising, and is calculated using the following formula:
[0050] in, Number of noise points This represents the total points for each flight. A retention rate that is too high indicates insufficient noise reduction, while a retention rate that is too low indicates excessive noise reduction. The scoring uses a piecewise function: a lower score is given when the retention rate is below 50%, a full score of 1.0 is given in the 80%-85% range, and the score gradually decreases after exceeding 85%, reflecting an optimization strategy that prioritizes high recall.
[0051] Cohesion measures the density of data points within the same cluster, reflecting the spatial accuracy of berth identification. It calculates the average distance from each point to other points in the cluster; a smaller distance indicates a denser cluster. The scoring rules are as follows:
[0052] in, Indicates the degree of cohesion. The overall cohesion is obtained by averaging the scores of all clusters based on the average distance from each point to other points in the same cluster.
[0053] Separability measures the degree of distinction between different clusters, reflecting the clarity of berth boundaries. It calculates the minimum distance from each sample point to its nearest neighbor cluster; a larger distance indicates a more distinct distinction between clusters. The scoring rules are as follows:
[0054] in, Indicates the degree of separation. The minimum distance from a sample point to its nearest neighbor cluster is 100 meters, which is the baseline value for a reasonable distance between berths. The overall separation is obtained by averaging the scores of all sample points.
[0055] Noise removal accuracy measures the degree of isolation of points marked as noise, reflecting the accuracy of noise removal. A piecewise function is used for scoring. The average distance from all noise points to the nearest normal point is calculated; a larger distance indicates a more isolated noise point. The scoring uses a piecewise function: a lower score is given when the average distance is less than 50 meters, increasing linearly between 50 and 150 meters, and a full score of 1.0 is given when the average distance is greater than 150 meters, ensuring that the removed noise points are indeed far from the normal berthing area.
[0056] Intra-cluster dispersion is evaluated using the maximum distance within the cluster to assess cluster compactness, reflecting the spatial span of the berth. The maximum distance between any two points within each cluster is calculated; the smaller the distance, the more compact the cluster. The scoring formula is:
[0057] in, Indicates intra-cluster dispersion. The maximum distance between any two points within a cluster is given by 200 meters, which is the baseline value for the length of a typical wharf. The average value of all cluster scores is used to obtain the overall cluster dispersion.
[0058] Inter-cluster distance measures the minimum distance between nearest neighbor clusters, reflecting the degree of spatial separation between different berths. It calculates the minimum point-to-point distance between all different cluster pairs; a larger distance indicates better inter-cluster differentiation. The scoring rules are as follows:
[0059] in, Indicates the inter-cluster distance. The minimum point-to-point distance between different clusters is 50 meters, which is the baseline value for the minimum safe distance. The average distance between all clusters is used to obtain the overall inter-cluster distance.
[0060] A water area identification model is constructed, and the optimal parameter combination is adaptively determined using a Bayesian optimization method. Specifically, in a preferred embodiment of this invention, the optimal value of the parameter combination, including spatial distance coefficients, is determined using a Bayesian optimization method. Density coefficient and minimum number of stops threshold .
[0061] Transition score of direction-aware DBI The objective function is:
[0062] in, This is for Direction-Aware DBI. A smaller value indicates better clustering quality.
[0063] Define spatial distance coefficients respectively Density coefficient and minimum number of stops threshold Search space, spatial distance coefficient The value range is [0.2, 0.8], and the density coefficient is... The value range is [0.01, 0.1], which is the minimum number of stops threshold. The value range is {2,3,4,5}.
[0064] A tree-structured Palzen estimator (TPE) is used as a probabilistic surrogate model to initialize a Gaussian process or TPE model. Random sampling is performed within the parameter search space to generate an initial set of parameter combinations. A clustering algorithm is then run on each parameter combination to calculate the corresponding... Update the proxy model. Based on the desired improvement of the acquisition function, select the next set of parameters to be evaluated, run clustering and evaluate, and update the model. Repeat the model update until the preset number of iterations is reached (set to 10). The parameter combination that maximizes the objective function is taken as the optimal one. , and value.
[0065] Adaptive iterative clustering is performed based on the optimal parameter combination to aggregate mooring points into multiple candidate clusters. Specifically, in a preferred embodiment of this invention, adaptive iterative clustering is used to assess spatial distance... and minimum sample size Dynamic updates:
[0066]
[0067] in, This is the spatial distance coefficient. Density coefficient This represents the average distance from all non-noise points to their respective cluster centroids in the current iteration. The total number of samples, The number of noise samples. This represents the number of clusters in the current iteration. This represents the average number of sample points per cluster, reflecting the average size of clusters in the current clustering results. It is an integer function. The lower bound of 3 ensures... The value should be at least 3 to avoid forming single-point clusters. The termination condition for adaptive iterative clustering is the current iteration's... Compared with the previous iteration The difference is less than the preset threshold , Set to 300 meters.
[0068] The results of adaptive iterative clustering are subjected to multi-level post-processing to obtain berth clusters and anchorage clusters. In a preferred embodiment of this invention, the multi-level post-processing includes: berth merging based on time information, deletion of misidentified berths based on coastline data, anchorage identification, and anomaly removal. High-density strip-shaped berths with consistent course and distributed along container berths are classified as berth clusters; low- to medium-density circular or irregularly scattered areas of berths with irregular course in offshore waters are classified as anchorage clusters.
[0069] Berth merging based on time information means that for any two clusters, if the centroid distance between the two clusters is less than 500 meters and the berthing time intervals of all ships do not overlap, then the two clusters will be merged into the same berth.
[0070] The method for deleting misidentified berths based on coastline data involves introducing real coastline data and calculating the shortest spherical distance from the center point of the berth cluster to the nearest coastline segment. If the distance is greater than 600 meters, the berth is determined to be a misidentified berth, and the center point of the current berth cluster is removed from the berth set and added to the anchorage candidate pool.
[0071] Anchorage identification involves secondary clustering using the DBSCAN algorithm on points marked as noise and points removed from misidentified berths, with the spatial neighborhood radius determined. Set the distance to 1000 meters, minimum sample size Set it to 50 to mark the non-noise points in the clustering results as anchorage regions.
[0072] Abnormal removal refers to the process of counting the number of times different vessels in each berth cluster and anchorage cluster call out. If the number of calls is less than the minimum number of calls threshold, the vessel is removed from the list. If a point falls within the bulge of any berth, it is considered an abnormal mooring point and is removed. Check if any point in each anchorage cluster falls within the bulge of any berth; if so, it is removed.
[0073] The berth clusters are validated and evaluated using a container berth benchmark dataset to determine the berth waters of the port. In a preferred embodiment of this invention, the geometric center point is calculated for any berth cluster. Construct a set of container berth segments. ,in For the first A container berth section. Calculate the center point. Shortest spherical distance to container berth section assembly Specifically, it includes: Calculate the center point Project the perpendicular line onto the berth segment and determine if the projected point lies between the endpoints of the berth segment. If the projected point lies on the segment, then the distance is... This is the distance from the center point to the projection point. If the projection point is not on the line segment, then the distance is... Take the smaller of the distances from the center point to the two endpoints of the line segment and record the minimum distance value. If the shortest spherical distance If the distance is less than a preset threshold, preferably 500 meters, the berth cluster is considered correctly identified. Based on the number of correctly identified berth clusters, the precision and recall rates of berth identification are calculated.
[0074] The method for calculating the berth identification recall rate is as follows:
[0075] in, For recall rate, The number of berth segments that are correctly associated. This represents the total number of berth sections.
[0076] A correctly associated berth segment indicates a container berth segment. If at least one berth cluster exists, its center point to this berth section Shortest spherical distance < 500 meters is used to determine the berth section. It was correctly associated.
[0077] Anchorage clusters are verified using a grid density-based spatial analysis method to determine port anchorages and identify container operation waters. In a preferred embodiment, ship status tags from AIS data are used to filter records in the anchored state, serving as the foundation data for constructing anchorage reference benchmarks. Anchorage reference polygons are generated based on grid density clustering, specifically including: dividing the study area into regular grid cells of 0.003° × 0.003° using a Geohash coding system; counting the number of candidate mooring points within each grid cell to construct a density matrix. The 70th percentile of the density value was used as the threshold. Filter out High-density grid cells are used. Isolated small-scale grid regions are eliminated. Adjacent high-density grid cells are identified to form connected regions as candidate anchorage areas. Candidate anchorage areas with a spatial distance of less than 1.5 kilometers are merged to generate the final anchorage reference polygon. .
[0078] The accuracy of anchorage clusters identified by the model is verified and optimized based on spatial overlay analysis, specifically including: generating convex hull polygons for each anchorage cluster. and anchorage reference polygon The proportion of the spatial intersection area of two polygons to the area of the convex hull polygon of the anchor cluster identified by the model is calculated using the following formula:
[0079] If the intersection ratio If the intersection ratio is [value missing], then the anchorage cluster is considered correctly identified. If the identification is incorrect, the cause of the identification deviation will be further analyzed.
[0080] Example like Figure 1 As shown, this invention provides an adaptive identification method for port waterways that integrates Bayesian optimization and density clustering. The implementation process of this invention will be described in detail below using the first port and the second port as examples.
[0081] S1. Data Acquisition and Preprocessing This embodiment uses AIS data from major container ports along the Chinese coast from August 2025 to January 2026. The original AIS data includes fields such as vessel MMSI code, timestamp, ground speed, latitude and longitude coordinates, heading, port code of the end of the voyage, and vessel operating status. First, container ship data is filtered using a list of five-letter codes corresponding to each port. For the first port, five-letter codes such as CNNGB, CNZOS, CNNBO, and CNNBG are used; for the second port, five-letter codes such as CNSHA and CNSHG are used. Then, spatial clipping is performed based on the geographical latitude and longitude range of each port. The latitude and longitude range of the first port is 29.5°N to 30.35°N and 121.6°E to 123.0°E, and the latitude and longitude range of the second port is 30.0°N to 31.6°N and 121.1°E to 123.0°E. After the above preprocessing, the first port retained 814,498 AIS records, involving 2,212 container ships; the second port retained 1,122,007 AIS records, involving 2,412 container ships.
[0082] S2, Construction of Real Berth Benchmark Dataset By combining online nautical charts, high-resolution satellite imagery, and five months of AIS vessel trajectory overlay analysis, a real container berth benchmark dataset was constructed through manual interpretation and plotting. Specifically, the basic geographic coordinates of the berth shorelines were first extracted from the online nautical charts. Then, high-resolution satellite imagery was overlaid to accurately locate and correct the berth shorelines. Historical AIS trajectory data was then used for verification to ensure consistency between the vessel activity characteristics and the markings in the berth area. Finally, each berth shoreline was recorded as having two endpoint coordinates, forming a set of berth segments. Following these steps, 10 container berth segments were marked at the first port, and 9 container berth segments were marked at the second port.
[0083] S3. Data Preprocessing and Mooring Point Extraction After completing the screening of target vessels at the port and constructing the benchmark dataset of actual berths, it is necessary to perform systematic preprocessing and berthing point extraction on the AIS dataset of container ships within the port. Module 1 contains two sub-modules: multi-level data preprocessing and Bayesian-optimized intra-voyage DBSCAN clustering denoising.
[0084] (a) Multi-level data preprocessing The raw AIS data suffers from high noise, uneven sampling frequency, and outlier interference, making it unsuitable for direct clustering and identification of berths and anchorages. To ensure the accuracy and efficiency of subsequent analysis, the dataset undergoes the following preprocessing operations: Data cleaning: First, filter the original AIS fields, retaining the ship's MMSI code, timestamp, and ground speed. ), latitude and longitude coordinates, and heading to the ground ( The system checks key fields such as the port code at the end of the voyage and the vessel's operational status, and deletes records with null values. Secondly, it performs anomaly detection based on speed and position. Records with speed anomalies are discarded to eliminate anomalies caused by equipment failure or data errors. Based on the principle of the continuity of ship motion, the spatial distance and time interval between adjacent records are calculated to estimate the average speed. Records with estimated speeds exceeding 50 knots are discarded as position anomalies to eliminate position jumps caused by signal interference or transmission errors.
[0085] Low-speed point filtering: To extract berthing status data of ships during their stay in port, a speed threshold is set to filter out low-speed points. The AIS records of the section are identified as anchorage points and retained, while other navigation status data are discarded. This operation yields anchorage status data points, providing core data support for port waterway identification.
[0086] Abnormal Vessel Identification and Removal: To avoid interference from extreme anomalies in the number of records per vessel due to AIS signal reception abnormalities or long-term inactivity, which could lead to clustering analysis, upper and lower thresholds are set for the number of berth records per vessel to identify and remove abnormal vessels. Specifically, vessels with fewer than 100 berth records are considered to have severely missing AIS signals and unreliable data, and are therefore removed. Vessels with more than 100,000 berth records are considered to be undergoing long-term maintenance, being idle, or experiencing AIS equipment malfunction; these densely populated areas can form pseudo-high-density regions that are easily misidentified as berths, and are also removed. This operation effectively eliminates the interference of extreme data on the clustering results.
[0087] Voyage segmentation: To address the issue of mixed data across different voyages caused by the same vessel berthing at the same port multiple times within the study period, a time interval method is used for voyage segmentation. AIS records for the same vessel are arranged in ascending order of time, and the time difference between adjacent records is calculated. .like Hours are considered as one port call; if Each hour is considered as two independent berthing events. This operation separates the ship's multiple berthing points, resulting in final data labeled with berth dates. This ensures that data from different berths remains independent during subsequent clustering, avoiding interference from confounding events.
[0088] After the above multi-level preprocessing, the cleaned, filtered, and segmented berthing status dataset is obtained.
[0089] (II) Intra-flight DBSCAN Clustering Denoising Based on Bayesian Optimization After multi-level data preprocessing, each voyage contains a large number of low-speed points, including both valid points where ships are berthed and abnormal noise points caused by signal drift, short waits, etc. To address this, the DBSCAN clustering algorithm is used, and Bayesian optimization is employed to adaptively determine the optimal parameters. This process is then used to refine the noise reduction of low-speed points within each voyage, extracting reliable berth point samples.
[0090] DBSCAN Algorithm Principle: DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a classic density-based clustering algorithm. Its core idea is: given a neighborhood radius... and minimum sample size If a certain point The neighborhood contains no less than A single point is called a core point; a cluster consists of a core point and its density-reachable boundary points. DBSCAN can discover clusters of arbitrary shapes without requiring a preset number of clusters, making it suitable for spatial clustering tasks of ship berths. However, traditional DBSCAN requires specific parameters... and Sensitive to this, a Bayesian optimization method is introduced to adaptively determine the optimal parameter combination.
[0091] Parameter Optimization Objective Function: The core of Bayesian optimization lies in constructing an objective function to quantify the clustering effect under different parameter combinations. A six-dimensional comprehensive evaluation index is constructed, and the weighted summation of the comprehensive score serves as the objective function for Bayesian optimization. The comprehensive score ranges from [0,1], with higher scores indicating better clustering performance. The calculation formula is as follows:
[0092] The definitions and calculation methods for each dimension are as follows: Data retention rate is scored using a piecewise function: a lower score is given when the retention rate is below 50%, a full score of 1.0 is given in the 80%-85% range, and the score gradually decreases after exceeding 85%, reflecting the optimization strategy of prioritizing high recall.
[0093] Cohesion: Calculate the average distance from each point to other points in the same cluster, where 20 meters is the baseline value for good mooring accuracy, and the average value of all cluster scores is taken.
[0094] Separation: Calculate the minimum distance from each sample point to its nearest neighbor cluster. 100 meters is the benchmark value for a reasonable distance between berths. The average score of all sample points is taken.
[0095] Noise removal accuracy: Calculate the average distance from all noise points to the nearest normal point. A score of 1.0 is given when the average distance is less than 50 meters, increases linearly between 50 and 150 meters, and is given full marks when the average distance is greater than 150 meters.
[0096] Intra-cluster dispersion: The maximum distance within the cluster is used for evaluation, with 200 meters being the benchmark value for a typical wharf length, and the average value of all cluster scores is taken.
[0097] Inter-cluster distance: Calculates the minimum point-to-point distance between different cluster pairs, where 50 meters is the baseline value for the minimum safe distance.
[0098] Bayesian optimization parameter finding based on TPE: The parameter search space is set to rice, The Tree-structured Parzen Estimator (TPE) is used as the probabilistic model, and the optimization process is as follows: Random initialization is performed, several sets of parameters are randomly sampled, DBSCAN clustering is run, and the corresponding comprehensive score is calculated.
[0099] Construct a probability model: Build a TPE probability model based on existing observation data.
[0100] Sample the next set of parameters, and sample the next set of parameters to be evaluated from the model based on the Expected Improvement (EI) criterion.
[0101] Evaluation and updates: run DBSCAN clustering and calculate the comprehensive score corresponding to the new parameter combination, add new observations to historical data, and update the probability model.
[0102] The iteration converges, and Steps 2 through 4 are repeated until the preset number of iterations is reached (50 in this study). The parameter combination with the highest overall score is then output as the optimal combination. and .
[0103] Simultaneously set the baseline parameter combination ( rice, This is used to compare the improvement after optimization.
[0104] Parameter-adaptive intra-flight clustering for noise reduction: The complete implementation process is as follows: Baseline testing, using fixed parameters rice, DBSCAN clustering was performed on all voyages, and the overall score was calculated as the baseline value.
[0105] Bayesian optimization uses all ship data as the optimization sample and performs 50 iterations within the parameter search space, aiming to maximize the overall score and search for the optimal parameter combination. .
[0106] Intra-flight clustering for noise reduction employs optimal parameter combinations. DBSCAN clustering was performed on all voyages, and points marked as noise were removed to obtain noise-free mooring point data.
[0107] The Bayesian optimization process described above automates and adaptively determines DBSCAN parameters, avoiding the inefficiency and subjectivity of manual trial and error. Running DBSCAN clustering with the optimized parameters allows for the extraction of high-quality ship berth point datasets from massive AIS data sets.
[0108] In this embodiment, the optimization results of the first port and the second port are shown in Table 1.
[0109] Table 1. Optimization results of DBSCAN parameters
[0110] S4, Parameter Adaptive Port Waterway Recognition Due to significant differences in the geographical features, berth layouts, and AIS data density of ports worldwide, using fixed parameters cannot guarantee generalization ability. The IMA-DBSCAN algorithm has successfully solved the spatial distance problem in traditional DBSCAN clustering. and minimum sample size A fixed problem, but and The iteration depends on the spatial distance coefficient. and density coefficient The selection of these two coefficients directly affects the accuracy of the clustering results, and traditional methods rely on manual experience to set them. and However, this approach struggles to adapt to the diverse berthing distribution characteristics of ships in different ports. Therefore, a Bayesian optimization method is introduced, constructing a Direction-Aware DBI (Davies-Bouldin Index) as the objective function to automatically search for the optimal parameter combination, achieving parameter self-adaptation for the port waterway identification method.
[0111] The port water area identification method consists of three core stages: the first stage is Bayesian hyperparameter optimization, which determines the optimal clustering parameters through adaptive search; the second stage is adaptive iterative clustering, which performs spatiotemporal iterative clustering based on the optimized parameters to identify berths and anchorages; and the third stage is multi-level post-processing, which improves the accuracy and reliability of the identification results through operations such as time information merging, coastline verification, anchorage identification, and anomaly removal.
[0112] (a) Direction-aware clustering quality assessment indicators 1. Limitations of traditional DBI Traditional Dispersion Bias (DBI) is an unsupervised clustering evaluation metric that measures the ratio of intra-cluster compactness to inter-cluster separation. However, port berths typically exhibit elongated geometric features, and the Euclidean distance from a point to its centroid cannot accurately reflect the density of samples within a cluster. For elongated berths, the distance from a point to its centroid is much greater than the perpendicular distance from a point to its central axis, causing traditional DBI to overestimate intra-cluster dispersion.
[0113] 2. Berth orientation extraction based on principal component analysis To accurately characterize the geometric features of the berths, this study employs Principal Component Analysis (PCA) to extract the principal directions for each berth location set. For berths containing... berth clustering at each point ,in .
[0114] First, calculate the cluster centers:
[0115] Then calculate the covariance matrix:
[0116] Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues. and its corresponding eigenvectors The first principal component direction Indicates the primary direction and the secondary principal component direction of the berth. This indicates the direction perpendicular to the berth. The length L and width W of the berth are respectively determined by the direction along... and The projection range of the direction is determined:
[0117] The centerline of a berth is defined as along... Direction through the center point The coordinates of the endpoints of the straight line are:
[0118] 3. The perpendicular distance from the point to the central axis For any point in the berth cluster The perpendicular distance to the axis is defined as the shortest spherical distance from a point to the central axis. Given endpoints A and B of the central axis, point... The perpendicular distance to line segment AB is calculated using vector projection. Since the ship's trajectory points are distributed on the Earth's surface, this study uses Haversine's formula to calculate the spherical distance between two points to avoid errors caused by planar approximation. First, the projection parameters are calculated. :
[0119] Will The projection point is restricted to the range [0,1] to ensure it falls on the line segment:
[0120] The coordinates of the projection point and the vertical distance are as follows:
[0121] Intra-cluster distance is defined as the average of the perpendicular distances from all points to the central axis:
[0122] 4. Calculation of minimum interval between berths For the two berth clusters and The interval distance is defined as the shortest distance between two convex hulls. Let... and The set of convex hull vertices are respectively and Then the inter-cluster distance is:
[0123] For clusters with fewer than 3 points, centroid distance is used as an alternative.
[0124] 5. Direction Awareness DBI Calculation Formula Based on the above definition, the formula for calculating orientation-aware DBI is:
[0125] in For the number of effective clusters, The distance within the cluster. This represents the inter-cluster distance. A smaller DBI value indicates better clustering quality: DBI < 0.5 is excellent, 0.5 ≤ DBI < 0.8 is good, 0.8 ≤ DBI < 1.2 is moderate, 1.2 ≤ DBI < 1.8 is poor, and DBI ≥ 1.8 is unacceptable.
[0126] (II) Bayesian Hyperparameter Optimization 1. Optimize problem definition The IMA-DBSCAN algorithm involves three key hyperparameters: spatial radius coefficient Points coefficient and minimum number of berthings The values of these parameters directly affect the quality of the clustering results. This study uses the Bayesian optimization method to automatically search for the optimal parameter combination. The optimization problem is defined as:
[0127] Where the objective function Defined as the conversion score of orientation-aware DBI:
[0128] The parameter search space is set as follows: , , .
[0129] 2. Bayesian optimization process Bayesian optimization employs a tree-structured Parzen Estimator (TPE) as a probabilistic surrogate model. Compared to traditional grid search or random search, Bayesian optimization can utilize historical evaluation results to guide subsequent sampling, finding the optimal parameters in a smaller number of trials.
[0130] Each experiment uses the complete dataset to run the IMA-DBSCAN clustering and post-processing workflow once, calculating the orientation-aware DBI and updating the surrogate model. After multiple experiments (10 experiments in this study), the parameter combination that maximizes the objective function is returned.
[0131] Through the above optimization process, the algorithm records the DBI score of each set of parameters within a finite number of iterations, and finally selects the parameter combination with the highest score as the input for subsequent clustering.
[0132] In this embodiment, the optimization results of the first port and the second port are shown in Table 2.
[0133] Table 2. Optimization results of the improved IMA-DBSCAN parameters
[0134] (III) Adaptive Iterative Clustering Based on the optimal parameters obtained through Bayesian hyperparameter optimization, the complete IMA-DBSCAN iterative clustering algorithm is executed. The core mechanisms in this stage include heading angle difference discrimination, dynamic parameter update, iterative convergence control, and berth merging based on time information.
[0135] 1. Calculation of heading angle difference To further improve the accuracy of distinguishing between berths and anchorages in port waters, the difference in heading angles is introduced as a key discrimination parameter. Let the heading angles of the two berths be... and Considering the periodicity of the heading angle, the heading angle difference... Defined as the smaller of the absolute value of the difference between the two and the supplementary angle of 360°:
[0136] 2. Definition of spatiotemporal neighborhood point neighborhood Defined as a set of points that simultaneously satisfies both a spatial distance threshold and a heading angle difference threshold:
[0137] in The geographic distance between two points is calculated using the following formula: This is the spatial distance threshold (unit: meters). The heading angle difference threshold (fixed at) If point The number of points in the neighborhood is not less than ,but The core point is marked as the core point, and the cluster consists of the core point and the boundary points that its density can reach.
[0138]
[0139] in( ), ( ) represent points respectively ,point The coordinates (latitude, longitude) are given in radians. km.
[0140] The point type determination rule is: if point The number of points in the neighborhood is not less than ,but Points are marked as core points; if there are not enough points but they are located in the neighborhood of a core point, they are marked as boundary points; otherwise, they are marked as noise points.
[0141] 3. Parameter update formula Based on the current clustering results, the parameters for the next iteration are updated. Unlike DBSCAN, which uses fixed parameters, IMA-DBSCAN dynamically adjusts the clustering parameters through iteration, enabling the algorithm to adapt to changes in data distribution.
[0142] Spatial distance threshold Controlled by the following formula:
[0143] in: These are coefficients obtained through Bayesian optimization, which control the degree of relaxation of the spatial neighborhood relative to the average dispersion within the cluster; It is the average distance from all points in the current iteration to the centroid of their respective clusters (dynamically changing), and this value gradually converges as the clustering process progresses.
[0144] Minimum number of neighborhood points Controlled by the following formula:
[0145] in: These are coefficients obtained through Bayesian optimization, which control the minimum density ratio required to form a cluster; This is the total number of sample points; This is the number of noise points in the current iteration; It is the number of clusters in the current iteration; This represents the average number of sample points per cluster, reflecting the average size of the clusters in the current clustering results; It is an upper floor function; the lower bound of 3 ensures... The value should be at least 3 to avoid forming single-point clusters.
[0146] 4. Iterative convergence conditions set up For the previous iteration The value is initially set to infinity. It is calculated after each iteration. Changes:
[0147] when When the average distance within a cluster changes by less than 300 meters, the clustering results are considered stable, and the iteration terminates. This convergence threshold is set based on the spatial scale of ship berthing: when the average distance within a cluster changes by less than 300 meters, it indicates that the cluster boundaries have basically stabilized, and continuing iteration has limited impact on the results.
[0148] 5. Time-based berth merging After clustering, each berth is labeled with a cluster label (positive number) or a noise label (-1), where the cluster corresponds to a potential berth and the noise label corresponds to a potential anchorage. Since berthing at the same berth may result in two different clusters due to port or starboard berthing, or the same berth may be identified as multiple adjacent clusters due to slight shifts in the ship's berthing position, timestamp information is used for merging.
[0149] First, identify berthing events. For each vessel, sort its berthing points by time. If the time interval between adjacent records exceeds 12 hours, it is considered two independent berthing events. Each berthing event corresponds to a time interval (start time and end time). Then, for any two clusters, extract the set of berthing time intervals for all vessels within that cluster. If any pair of time intervals overlaps, it means that two vessels berthed in these two clusters at the same time, and they are determined to be different berths. If all time intervals do not overlap, they are determined to be the same berth and are merged.
[0150] (iv) Multi-level post-processing The multi-level post-processing stage refines the clustering results, including time-based berth merging, deletion of misidentified berths, anchorage identification, and anomaly removal, to improve the accuracy and reliability of the final identification results.
[0151] 1. Time-based berth consolidation For any two clusters and If the distance between their centroids is less than 500 meters and the berthing time intervals of all ships do not overlap, then the two clusters are merged into the same berth. Here, 500 meters is the spatial merging threshold, and 12 hours is the temporal separation threshold. This strategy ensures that the trajectories of ships using the same berth in different time periods are correctly merged.
[0152] 2. Deletion of misidentified berths Some areas identified as berths may actually be located in the middle of the water (e.g., anchorages misidentified as berths). This invention verifies this by introducing real coastline data. A spatial index of the coastline is constructed, and a two-level indexing strategy using a grid index and a KD-tree is employed to achieve efficient distance queries.
[0153] For berth cluster C, first calculate its convex hull center point. Query Shortest spherical distance to the nearest coastline .like If the distance is greater than 300 meters, the berth is determined to be a misidentification, and all its points are removed from the berth set and added to the anchorage candidate pool.
[0154] 3. Anchorage identification The merged berth clusters correspond to ship berthing areas, while the points marked as noise theoretically correspond to anchorage areas. However, noise points may include genuine anchorage points, isolated noise caused by data anomalies, and abnormal berthing points with excessively low berthing frequencies. To accurately identify anchorages, secondary clustering of noise points is required. Based on the DBSCAN algorithm, the input data is the union of the original noise points and the deleted release points of misidentified berths. Considering that anchorage areas typically exhibit a circular dispersion characteristic, the spherical Haversine distance metric is used.
[0155] Spatial neighborhood radius Set to 1000 meters, minimum number of points Set to 50. This parameter is based on the typical distribution range of vessels in an anchorage: the distance between vessels within an anchorage is usually greater than the distance between vessels within a berth, therefore a larger neighborhood radius is used to initially identify anchorage clusters. Non-noise points in the clustering results are marked as anchorage areas.
[0156] 4. Abnormal removal In the final stage, low-frequency abnormal clusters are removed. For berth clusters and anchorage clusters, the number of berthings for different vessels in each cluster is counted. If the number of berthings is less than the minimum berthing threshold, the cluster is removed. (Automatically determined by Bayesian optimization, with a value ranging from 2 to 5), if the value is not an official berth or anchorage, it is considered an abnormal berth and is removed and remarked as noise. This threshold ensures that the identified berths have sufficient vessel usage records, excluding false berths formed by occasional moorings.
[0157] In addition, for berth clusters with at least 3 points, their convex hull polygons are generated, and it is checked whether the points of each anchorage cluster fall within the convex hull of any berth. If such a situation exists, it indicates that the anchorage cluster is too close to the berth, and may be a record of a vessel briefly waiting near the berth rather than a true anchorage area; in this case, it is also removed. This operation effectively distinguishes between the waiting area in front of the berth and the formal anchorage area.
[0158] After completing the above steps, the final output will be accurate berth clusters and anchorage clusters. Figure 2 and Figure 3 The clustering results of the first port and the second port are visualized respectively.
[0159] S5, Berth Cluster Verification and Evaluation For each identified berth cluster, first calculate its geometric center point. Then calculate Shortest spherical distance to the actual berth segment set In the specific calculation, first calculate the center point. By projecting the perpendicular onto the berth segment, determine whether the projected point lies between the endpoints of the berth segment; if the projected point lies on the segment, then the distance... The distance from the center point to the projection point; if the projection point is not on the line segment, then the distance is... Take the smaller of the distances from the center point to the two endpoints of the line segment. If If the distance is measured in meters, then the berth cluster is determined to be correctly identified.
[0160] The evaluation results are shown in Table 3 and compared with the original IMA-DBSCAN method. The method of the present invention achieved 100% precision and 100% recall in berth identification at all five ports, which is significantly better than the IMA-DBSCAN method (recall rate 60.0%-90.5%), indicating that the method of the present invention can effectively improve the coverage of berth identification while maintaining high precision.
[0161] Table 3 Comparison of the accuracy of berth identification results
[0162] S6, Anchor Cluster Verification and Assessment The anchorage cluster verification and evaluation employs a spatial analysis method based on grid density. First, the raw AIS data undergoes multi-level filtering to remove ground-to-ground flight speeds. Filter for ground speed anomalies by recording abnormal speeds and position jump anomalies where the instantaneous speed between adjacent trajectory points exceeds 50 knots. The low-speed points of the section are identified, and all berth locations identified in step four, as well as near-shore noise points within 500 meters of the shoreline, are removed. Then, records in the anchored state are filtered out using the ship status labels in the AIS data, serving as the basis data for constructing the anchorage reference benchmark.
[0163] Next, the study area was divided into regular grid cells of 0.003° × 0.003° using the Geohash coding system. The number of candidate mooring points in each grid cell was counted to construct a density matrix. High-density grid cells were selected using the 70th percentile of the density values as a threshold, and isolated small-scale grid areas were eliminated. Adjacent high-density grid cells were identified as connected regions as candidate anchorage areas. Candidate anchorage areas with a spatial distance of less than 1.5 kilometers were merged to generate the final anchorage reference polygon. Finally, the convex hull polygons of the anchorage clusters identified by the model are generated. and anchorage reference polygon Calculate the ratio of the spatial intersection area of the two polygons to the area of the anchorage reference polygon. .
[0164] If the intersection ratio If the intersection ratio is as stated, then the anchorage cluster is determined to be correctly identified; If the identification is incorrect, further analysis of the reasons for the identification deviation is required.
[0165] The evaluation results are shown in Table 4. The method of the present invention achieved an accuracy of 100% in anchorage identification in all five ports, verifying the effectiveness of the grid density clustering and spatial overlay analysis method.
[0166] Table 4. Accuracy of Anchorage Identification Results
[0167] S7. Results Visualization and Analysis Figure 2 This is a schematic diagram of the clustering results for the first port in an embodiment of the present invention. Figure 2 (a) is the original AIS berthing point distribution map, where gray dots represent all berthing points after speed screening; Figure 2 (b) is the result image after identification by the method of the present invention. The bold black dots represent the identified berth locations, and the light gray dots represent the identified anchor locations. From Figure 2 (b) It can be seen that the berth sites and anchorage sites are clearly distinguishable in space. The berth sites show a strip-like clustering feature along the wharf shoreline, while the anchorage sites show a relatively discrete circular area distribution. The identification results are in good agreement with the actual functional zoning of the port. Figure 3 This is a schematic diagram of the clustering results for the second port in an embodiment of the present invention. Figure 3 (a) is the original AIS berthing point distribution map, where gray dots represent all berthing points after speed screening; Figure 3 (b) is the result image after identification by the method of the present invention. The bold black dots represent the identified berth locations, and the light gray dots represent the identified anchor locations. From Figure 3(b) It can be seen that berth locations and anchorage locations can be clearly distinguished spatially. Berth locations exhibit a strip-like clustering pattern along the wharf shoreline, while anchorage locations show a relatively dispersed circular distribution. The identification results are highly consistent with the actual functional zoning of the port. The results show that this method can effectively distinguish between berths and anchorages in different port environments, verifying the generalization ability of the method.
[0168] The above results show that the method of the present invention can adaptively determine the optimal clustering parameters for different ports, with berth identification precision and recall both reaching 100%, anchorage identification precision also reaching 100%, and the clustering results highly consistent with the actual annotations, providing a reliable data foundation for subsequent applications such as port congestion analysis and ship behavior perception.
[0169] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A port water area self-adaptive recognition method fusing Bayesian optimization and density clustering, characterized in that, include: Obtain the raw AIS data of the target port, filter out the container ship data, and perform spatial cropping based on the geographical latitude and longitude range to obtain the container ship AIS dataset within the port, and construct the container berth benchmark dataset. Multi-level data preprocessing was performed on the AIS dataset of container ships in the port. The preprocessed container ship AIS data in the port was denoised by DBSCAN clustering within the voyage based on Bayesian optimization to obtain a ship berthing point dataset. A water area identification model is constructed, and the optimal parameter combination is adaptively determined using the Bayesian optimization method. The optimal value of the parameter combination, including the spatial distance coefficient, is determined using the Bayesian optimization method described above. Density coefficient and minimum number of stops threshold ; Transition score of direction-aware DBI The objective function is: in, Direction-aware DBI; Define spatial distance coefficients respectively Density coefficient and minimum number of stops threshold The search space is defined, and a tree-structured Palzen estimator (TPE) is used as a probabilistic surrogate model to initialize a Gaussian process or TPE model. Random sampling is performed within the parameter search space to generate an initial set of parameter combinations. A clustering algorithm is run on each set of parameters to calculate the corresponding parameters. Update the surrogate model; select the next set of parameters to be evaluated based on the expected improvement of the acquisition function, run clustering and evaluate, and update the model; repeat the model update until the preset number of iterations is reached, and output the parameter combination that maximizes the objective function as the optimal one. , and value; Based on the optimal parameter combination, adaptive iterative clustering is performed to aggregate the mooring points into multiple candidate clusters; The results of the adaptive iterative clustering are subjected to multi-level post-processing to obtain berth clusters and anchorage clusters; The berth cluster is verified and evaluated using the container berth benchmark dataset to determine the berth waters of the port; The anchorage clusters are verified using a spatial analysis method based on grid density to determine the anchorages of the port and identify the container operation waters.
2. The adaptive identification method for port waterways integrating Bayesian optimization and density clustering as described in claim 1, characterized in that, The container ship data is filtered based on the port code of the end of the voyage. The port code of the end of the voyage is a five-letter port code. The trajectory of container ships belonging to the target port is extracted from the original AIS data through a preset list of target port five-letter codes. The geographical latitude and longitude range is set according to the actual water boundary of the target port. The construction of the container berth benchmark dataset utilizes online nautical charts, high-resolution satellite imagery, and historical AIS vessel tracks for overlay analysis to determine the location of container berths and the orientation of the shoreline, forming berth benchmark data for accuracy verification.
3. The adaptive identification method for port waterways integrating Bayesian optimization and density clustering as described in claim 1, characterized in that, The multi-level data preprocessing includes data cleaning, low-speed point screening, abnormal vessel identification and removal, and voyage segmentation. The data cleaning process involves filtering and retaining the ship's MMSI code, timestamp, and ground speed. Latitude and longitude coordinates, heading towards the ground Remove null records from the port code and vessel operation status fields at the end of the voyage; set the ground speed... Records exceeding the first ground speed threshold are judged as speed abnormalities and are removed; Based on the continuity of ship motion, the average speed is calculated by measuring the spatial distance and time interval between adjacent records. Records whose calculated speed exceeds the threshold are judged as positional anomalies and are removed. The low-speed point screening is achieved by checking the ground speed. AIS records below the second ground speed threshold are identified as anchorage points and retained, while other navigation data are discarded. The abnormal vessel identification and removal process involves identifying and removing vessels with fewer than the first berthing record threshold as having unreliable data, and removing vessels with more than the second berthing record threshold as having been idle for a long time or with equipment failure. The voyage segmentation is achieved by arranging the AIS records of the same vessel in ascending order of time and calculating the time difference between adjacent records. ,like Hours are considered as one port call, if Each hour is considered as two independent port calls, resulting in data tagged with voyage number.
4. The adaptive identification method for port waterways integrating Bayesian optimization and density clustering as described in claim 1, characterized in that, The Bayesian-optimized intra-flight DBSCAN clustering denoising method uses a comprehensive score as the objective function. This comprehensive score is calculated by weighting data retention rate, cohesion, separation, noise removal accuracy, intra-cluster dispersion, and inter-cluster distance. The calculation formula is as follows: in, For data retention rate, For cohesion, For resolution, For noise removal accuracy, Intra-cluster dispersion Inter-cluster distance; The data retention rate is used to measure the proportion of effective data retained after denoising, and the calculation formula is: in, Number of noise points Total points for the voyage; The cohesion is used to measure the density of data points within the same cluster, reflecting the spatial accuracy of berth identification. The scoring rules are as follows: in, Indicates the degree of cohesion. The overall cohesion is obtained by averaging the scores of all clusters based on the average distance from each point to other points in the same cluster. The separation degree is used to measure the degree of distinction between different clusters, reflecting the clarity of the berth boundary. The scoring rules are as follows: in, Indicates the degree of separation. The minimum distance from a sample point to its nearest neighbor cluster is 100 meters, which is the baseline value for a reasonable distance between berths; the overall separation is obtained by averaging the scores of all sample points. The noise removal accuracy is used to measure the degree of isolation of points marked as noise, reflecting the accuracy of noise removal, and is scored using a piecewise function; The intra-cluster dispersion is evaluated using the maximum intra-cluster distance to assess the cluster's compactness, reflecting the spatial span of the berth. The scoring formula is as follows: in, Indicates intra-cluster dispersion. The maximum distance between any two points within a cluster is given by 200 meters, which is the baseline value for the length of a typical wharf. The average value of all cluster scores is used to obtain the overall cluster dispersion. The inter-cluster distance is used to measure the minimum distance between nearest neighbor clusters, reflecting the degree of spatial separation between different berths. The scoring rules are as follows: in, Indicates the inter-cluster distance. The minimum point-to-point distance between different clusters is 50 meters, which is the baseline value for the minimum safe distance. The average distance between all clusters is used to obtain the overall inter-cluster distance.
5. The adaptive identification method for port waterways integrating Bayesian optimization and density clustering as described in claim 1, characterized in that, Using the aforementioned adaptive iterative clustering, spatial distance and minimum sample size Dynamic updates: in, This is the spatial distance coefficient. Density coefficient This represents the average distance from all non-noise points to their respective cluster centroids in the current iteration. The total number of samples, The number of noise samples. This represents the number of clusters in the current iteration. This represents the average number of sample points per cluster, reflecting the average size of the clusters in the current clustering results; The function is the floor function; the termination condition of the adaptive iterative clustering is the current iteration's floor function. Compared with the previous iteration The difference is less than the preset threshold .
6. The adaptive identification method for port waterways integrating Bayesian optimization and density clustering as described in claim 1, characterized in that, The multi-level post-processing includes: berth merging based on time information, deletion of misidentified berths based on coastline data, anchorage identification and anomaly removal; classifying high-density strip-shaped berths with consistent course and distributed along container berths into berth clusters; and classifying medium- and low-density circular or irregularly scattered areas of berths with irregular course in offshore waters into anchorage clusters. The time-based berth merging means that for any two clusters, if the centroid distance between the two clusters is less than 500 meters and the berthing time intervals of all ships do not overlap, then the two clusters will be merged into the same berth. The method for deleting misidentified berths based on coastline data involves introducing real coastline data and calculating the shortest spherical distance from the center point of the berth cluster to the nearest coastline segment. If the distance is greater than 600 meters, the berth is determined to be a misidentified berth, and the center point of the current berth cluster is removed from the berth set and added to the anchorage candidate pool. The anchorage identification process involves secondary clustering using the DBSCAN algorithm on points marked as noise and points that were mistakenly identified as berths and subsequently deleted. The non-noise points in the clustering results are then marked as anchorage areas. The term "abnormal removal" refers to counting the number of times different vessels in each berth cluster and anchorage cluster have berthed. If the number of berths is less than the minimum berth count threshold, the vessel is removed from the list. If a point is found to be an abnormal mooring point, it will be removed. Check whether the point of each anchorage cluster falls within any berth bulge; if so, it will be removed.
7. The adaptive identification method for port waterways integrating Bayesian optimization and density clustering as described in claim 1, characterized in that, The verification and evaluation of the berth cluster specifically includes: For any cluster of berths, calculate the geometric center point. Construct a collection of container berth sections. ,in For the first Container berth section; calculate center point The shortest spherical distance to the set of container berth sections Specifically, it includes: Calculate the center point Project the perpendicular line onto the berth segment and determine if the projection point lies between the endpoints of the berth segment; if the projection point lies on the segment, then the distance... The distance from the center point to the projection point; if the projection point is not on the line segment, then the distance is... Take the smaller of the distances from the center point to the two endpoints of the line segment and record the minimum distance value. If the shortest spherical distance is If the number of berth clusters is less than a preset threshold, the berth cluster is determined to be correctly identified; based on the number of correctly identified berth clusters, the precision and recall of berth identification are calculated. The method for calculating the berth identification recall rate is as follows: in, For recall rate, The number of berth segments that are correctly associated. This represents the total number of berth sections. The correctly associated berth segment refers to a container berth segment. If at least one berth cluster exists, its center point to this berth section Shortest spherical distance If the value is less than the preset threshold, then the berth section is determined. It was correctly associated.
8. The adaptive identification method for port waterways integrating Bayesian optimization and density clustering as described in claim 1, characterized in that, The verification and evaluation of the anchorage cluster specifically includes: Using ship status labels from AIS data, records in the anchored state are selected as the basis for constructing the anchorage reference benchmark. Anchorage reference polygons are generated based on grid density clustering, specifically including: dividing the study area into regular grid cells using the Geohash coding system; counting the number of candidate mooring points within each grid cell; and constructing a density matrix. Set threshold Filter out The process involves: using high-density grid cells; eliminating isolated small-scale grid regions; identifying connected regions formed by adjacent high-density grid cells as candidate anchorage areas; and merging candidate anchorage areas with a spatial distance of less than 1.5 kilometers to generate the final anchorage reference polygon. ; The accuracy of anchorage clusters identified by the model is verified and optimized based on spatial overlay analysis, specifically including: generating convex hull polygons for each anchorage cluster. and the anchorage reference polygon The formula for calculating the ratio of the spatial intersection area of two polygons to the area of the convex hull polygon of the anchor cluster identified by the model is as follows: If the intersection ratio If the intersection ratio is as stated, then the anchorage cluster is determined to be correctly identified; If the identification is incorrect, the cause of the identification deviation will be further analyzed.
Citation Information
Patent Citations
Ship port entering and leaving prediction method based on multi-modal neural network and adaptive LSTM
CN120123976A
Method for acquiring high-temporal-spatial-resolution port traffic observation data from AIS (Automatic Identification System) data
CN120526387A