Ship arrival time segment prediction method and system based on complex network
Through a complex network-based method, the feature data importance score and the complexity score are calculated, the flight segments are divided, and the CNN-LSTM model is optimized, which solves the problem of insufficient prediction accuracy of ship arrival time in the prior art, and achieves efficient and accurate prediction in complex waterway environments.
Patent Information
- Application Number
- CN202510611130.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-08
AI Technical Summary
When the existing time series prediction model deals with complex and changeable inland waterway environments, it is difficult to accurately predict ship arrival time, especially when facing dynamically changing waterway conditions and complex ship behavior, the prediction accuracy decreases and lacks the ability to adapt to the complexity of different flight segments.
The ship arrival time segment prediction method is adopted based on complex networks. By calculating the importance score of feature data, the complexity score is constructed, the flight segment is divided, and the features are weighted by LightGBM and XGBoost models, and the CNN-LSTM model is optimized in combination with whale optimization algorithm to realize the segment prediction of ship arrival time.
It improves the accuracy and adaptability of ship arrival time prediction, and can provide efficient and accurate prediction results in complex and changeable waterway environments, reduces redundancy in model input, and improves computing efficiency and prediction accuracy.
Smart Images

Figure CN120450143A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship traffic control, and in particular to a method and system for segmented prediction of ship arrival time based on a complex network. Background Art
[0002] In the actual operation of inland waterway transportation, accurate prediction of vessel arrival times helps ports and shipping companies dispatch resources more efficiently, reduces vessel waiting time, improves terminal operations, and supports shipping dispatch centers in effectively regulating traffic flow, thereby reducing the risk of waterway congestion. However, complex waterway conditions and a volatile traffic environment pose numerous challenges to ship arrival time prediction.
[0003] Existing time series forecasting models, such as the autoregressive moving average (ARIMA) model, support vector machines (SVM), and simple long-short-term memory (LSTM) networks, can address the problem of ship arrival time prediction to a certain extent. However, these models often rely on fixed assumptions and data patterns. These models can only provide limited predictive capabilities when dealing with dynamically changing waterway environments and complex ship behaviors.
[0004] However, these existing models have obvious limitations when faced with the complex and ever-changing inland waterway environment. When waterway conditions change dynamically or ship behavior is complex, the prediction accuracy of these models will drop significantly. In addition, these models lack the ability to adapt to the complexity of different sections and have difficulty coping with the complex and changing characteristics of inland waterway sections. At the same time, simple machine learning models cannot fully capture the complex relationship between waterway characteristics and the dynamic behavior of ships. For inland shipping, there are nonlinear relationships and long-term dependencies between the conditions of different sections and the characteristics of ships, which are crucial for accurate prediction of arrival times. Therefore, when processing shipping data with complexity and time dependence, more advanced and intelligent models are needed to improve the accuracy of predictions. Summary of the Invention
[0005] The present invention proposes a segmented prediction method and system for ship arrival time based on complex networks, which solves the problem that existing prediction models are difficult to cope with the complex changes in inland river ship sections.
[0006] To solve the above technical problems, the present invention provides a method for predicting ship arrival time segmentation based on a complex network, comprising the following steps: Step S1: The ship's AIS data, channel characteristics, and traffic environment characteristics are used as feature data, and the importance scores of all feature data are calculated. Feature data with an importance score greater than a set importance threshold is regarded as an important feature; Step S2: weighting the important features according to the importance scores to obtain a complexity score for each track point in the AIS data; Step S3: Traverse all track points. If the difference between the complexity scores of two adjacent track points is less than the set threshold, the two track points are divided into the same segment, otherwise they are divided into different segments. Step S4: annotate important features according to the results of the segment division, use the annotated important features to train the prediction model, and use the trained prediction model to achieve segmented prediction of the ship arrival time.
[0007] Preferably, calculating the importance scores of all feature data in step S1 includes the following steps: Step S11: Train the lightweight gradient boosting machine LightGBM and the extreme gradient boosting XGBoost model respectively. The LightGBM and XGBoost models calculate the importance score of each feature data through the node splitting gain in the decision tree: ; Where, It is a feature Importance score; Contains features The number of decision trees; It is In a decision tree, the features The gains from partitioning nodes; Step S12: Perform weighted fusion on the importance scores of each feature calculated by the LightGBM and XGBoost models: ; Where, Features The comprehensive importance score of 、 are the weights of LightGBM and XGBoost models respectively; Features Importance score in LightGBM model; Features Importance score in XGBoost model; Step S13: Standardize the importance score of each feature: ; Where, is the raw feature importance score; is the minimum value among all feature scores; is the maximum value among all feature scores; is the normalized feature importance score.
[0008] Preferably, the characteristic data in step S1 further includes waterway mileage, which is obtained by calculating the geographical distance between nodes. The expression for calculating the geographical distance between nodes is: ; Where, is the geographical distance between two track points; is the radius of the Earth; 、 are the latitudes of the two track points respectively; 、 are the longitudes of the two track points respectively.
[0009] Preferably, the step S4 of training the prediction model using the annotated important features includes the following steps: Step S41: using the local feature extraction module in the prediction model to extract local features from the important features, using the time series feature extraction module in the prediction model to extract time series features from the local features, and using the local features and time series features to predict the arrival time of the ship; Step S42: Optimize the parameters of the local feature extraction module and the temporal feature extraction module using the whale algorithm (WOA).
[0010] Preferably, step S42 includes the following steps: Step S421: Set the number of whales and the maximum number of iterations, and initialize the positions of all whales; Step S422: Calculate the fitness of each whale, identify and retain the optimal whale position; Step S423: Generate a random number ,like If it is less than 0.5, then step S424 is executed; otherwise, the bubble net predation mechanism is used to update the whale's position; Step S424: Calculate the coefficient vector of the algorithm ,like If the absolute value of is less than 1, the prey is surrounded and the whale's position is updated. Otherwise, the prey is searched randomly globally and the whale's position is updated. Step S425: Calculate the fitness of each whale and compare it with the retained optimal whale position. If the current fitness is better, update the optimal solution. Step S426: Determine whether the current number of iterations reaches the set maximum number of iterations. If so, the optimal solution is obtained; otherwise, return to step S423.
[0011] Preferably, the expression of the bubble net predation mechanism in step S423 is: ; ; Where, A vector pointing to the optimal position for the whale's current position; is the current global optimal whale position; For the The whale position at the iteration; is a random number used to simulate the randomness of spiral motion; is a constant that controls the shape of the spiral curve; is a mathematical constant.
[0012] Preferably, the expression for surrounding the prey in step S424 is: ; ; Where, Current location of the whale and the global optimal solution position the distance between them; is the coefficient vector; is the current global optimal whale position; For the The whale position at the iteration; is the coefficient vector.
[0013] Preferably, the expression for the global random search for prey in step S424 is: ; ; ; ; ; In the above formula, Current location of the whale With randomly selected positions the distance between them; 、 is the coefficient vector; is the next position of a randomly selected whale; For the The whale position at the iteration; is a random number in the interval [0,1]; is a linear decay variable; is the current iteration number; is the maximum number of iterations.
[0014] The present invention also provides a complex network-based ship arrival time segmentation prediction system, which is implemented based on the above-mentioned complex network-based ship arrival time segmentation prediction method, including: a data acquisition module, a feature engineering module, a segment division module, and a model training and prediction module; The data acquisition module collects the position, speed and heading of the ship during navigation from the ship automatic identification system AIS, and obtains the channel curvature, water depth, width and ship flow in the water area as characteristic data; The feature engineering module calculates the importance scores of all feature data, selects important features with importance scores greater than a set threshold, and eliminates irrelevant or less influential features; The segment division module divides the navigation waters of the ship into segments according to the complexity score and the set complexity threshold. When the difference in complexity score between two adjacent nodes is greater than the set threshold, they are divided into different segments. The model training and prediction module uses the important features of different sections to train the prediction model, applies the trained model to actual prediction, and predicts the arrival time of ships in different sections according to the input real-time ship data and channel information, and outputs the prediction results.
[0015] Preferably, the system further comprises an evaluation and optimization module, which calculates the root mean square error (RMSE), mean absolute error (MAE) and coefficient of determination (R²) between the actual arrival time and the predicted arrival time of the ship, evaluates the performance of the prediction model, and optimizes the feature engineering module and the model training and prediction module according to the evaluation results.
[0016] The benefits of the present invention include at least: 1. By calculating the importance scores of all feature data and selecting features with importance scores greater than the set threshold as important features, it can effectively eliminate irrelevant or redundant features, reduce the complexity of model input, and enable the model to focus on key information, thereby improving computing efficiency and prediction accuracy, and providing a high-quality data foundation for subsequent modeling and prediction; 2. Constructing a complex network with track points as nodes and geographic distances as edge weights can accurately reflect the spatial structure and actual conditions of the track, providing an effective framework for subsequent network-based segment division and analysis, and helping to deeply understand the relationships and patterns between ship navigation trajectories; 3. The complexity score is calculated based on the weighted importance scores of important features, and the segments are divided according to the set complexity threshold. This can fully consider the actual complexity of the waterway and the changes in the ship's navigation conditions, ensure that segments of different complexities are reasonably distinguished, and make the characteristics of each segment relatively consistent. This is conducive to improving the adaptability and pertinence of the prediction model for different segments, thereby improving the accuracy of ship arrival time prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Schematic diagram of a method flow in an embodiment of the present invention; Figure 2 Schematic diagram of the feature extraction process in an embodiment of the present invention; Figure 3 Schematic diagram of track point complexity in an embodiment of the present invention; Figure 4 Schematic diagram of segmentation results of a complex network in an embodiment of the present invention; Figure 5 The following is a comparison chart of the prediction results of different methods in water areas 1-3; Figure 6 The following is a comparison chart of the prediction results using different methods in water areas 4-7. DETAILED DESCRIPTION
[0018] The following is a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts are within the scope of protection of the present invention.
[0019] like Figure 1 As shown, an embodiment of the present invention provides a segmented prediction method for ship arrival time based on a complex network, comprising the following steps: Step S1: The ship's AIS data, channel characteristics, and traffic environment characteristics are used as feature data, and the importance scores of all feature data are calculated. Feature data with an importance score greater than a set importance threshold is used as an important feature.
[0020] Specifically, the processing of ship data and the collection of channel characteristics are the basis of the entire model. Figure 2 As shown, the data collected in the embodiment of the present invention includes Automatic Identification System (AIS) data, such as longitude, latitude, course over ground, speed over ground, navigation status, Maritime Mobile Service Identity (MMSI), ship type, length, width, and deadweight tonnage; channel characteristics, such as channel width, channel depth, and channel curvature; and traffic environment characteristics, such as ship traffic volume. Channel characteristics are obtained online through public websites, while traffic volume is determined by using geographic location mapping tools to demarcate anchorages and waters associated with the main channel. Historical trajectory analysis and extraction are performed on ships passing through a specific area for a continuous period of time. Subsequently, ship information is classified and screened to compile historical ship traffic flow data, which is used to screen ship traffic flow and classify data to ensure the accuracy of the data categories imported into the model.
[0021] Since latitude and longitude are time-varying position data and are difficult to effectively represent the actual navigation path of a ship, the embodiment of the present invention uses multiple existing variables to create a new feature: the channel distance as the input of the subsequent model. Given the longitude and latitude, the channel distance between the current position of the ship and the destination can be calculated. L : ; Where, For the first A latitude and longitude point, representing the current position of the ship; From the position arrive Actual waterway distance; is the number of navigation points on the route.
[0022] After acquiring a vessel's AIS data, data cleaning is required, primarily to correct the dynamic position data within the AIS data. In addition to missing trajectory data due to equipment errors and network transmission, the collected raw data also contains outliers and noise. It is necessary to remove AIS data that is identical when the vessel is stationary, data with speeds outside the normal range, and data with offset vessel trajectory positions.
[0023] In this embodiment of the present invention, feature screening and ranking are key steps in improving model prediction accuracy. By selecting features closely related to ship arrival time prediction from numerous input features, model input redundancy can be effectively reduced, thereby improving computational efficiency and prediction accuracy. This process not only optimizes data preprocessing but also simplifies the model structure and enhances training efficiency. The selected features serve as input for complex network modeling, providing high-quality data support for subsequent segmentation and prediction. To achieve this, this embodiment of the present invention utilizes an ensemble learning method, the Stacking algorithm. The Stacking algorithm trains multiple base learners and passes their outputs as input features to a meta-learner. In this embodiment of the present invention, the Lightweight Gradient Boosting Machine (LightGBM) and Extreme Gradient Boosting (XGBoost) models are used as base learners, and the Ridge Regression model is used as a meta-learner to rank feature importance in high-dimensional data. In this embodiment of the present invention, the Stacking algorithm is primarily used for feature screening and ranking, rather than traditional prediction capability enhancement.
[0024] In the specific operation, LightGBM and XGBoost models are trained respectively. These two models calculate the importance of features through node splitting gain in decision trees, and train and analyze all features. In the training process of each tree, the featuref When used as a split node, if the loss of the objective function can be minimized, the feature is considered f By accumulating the gains of multiple trees, we can get the feature f The importance score in the entire model. The calculation expression of the importance score is: ; Where, It is a feature Importance score; Contains features The number of decision trees; It is In a decision tree, the features The gain from partitioning nodes.
[0025] In order to integrate the feature importance of different models, this paper adopts the weighted average method to fuse the feature importance scores of LightGBM and XGBoost. The reason for choosing weighted average is that both LightGBM and XGBoost are ensemble models based on gradient boosting trees, and their feature importance scores are calculated based on the gain in the tree model, which has strong interpretability and stability. The expression for weighted fusion of feature importance scores is: ; Where, Features The comprehensive importance score of 、 are the weights of the LightGBM and XGBoost models, respectively. In the embodiment of the present invention, both are set to 0.5, indicating that the importance scores of the two models have equal influence; Features Importance score in LightGBM model; Features Importance score in XGBoost model.
[0026] Since the importance scores of different features may have different numerical ranges, MinMaxScaler is used to normalize the feature importance scores. The normalized feature importance scores will be between 0 and 1, ensuring that the importance of each feature is at the same level and avoiding the influence of extreme values. The calculation formula of MinMaxScaler is as follows: ; Where, is the raw feature importance score; is the minimum value among all feature scores; is the maximum value among all feature scores; is the normalized feature importance score.
[0027] Normalization ensures that the scores of each feature satisfy the constraint of summing to 1 after weighted fusion, making the analysis more intuitive and comparable. Finally, a ridge regression model is used to rank all features according to their importance scores after fusion, and to remove features that are irrelevant or have little impact on the prediction.
[0028] Step S2: Weight the important features according to the importance scores to obtain the complexity score of each track point in the AIS data.
[0029] Step S3: Traverse all track points. If the difference between the complexity scores of two adjacent track points is less than the set threshold, the two track points are divided into the same segment, otherwise they are divided into different segments.
[0030] Specifically, the embodiment of the present invention divides the waterway into multiple segments of relatively consistent complexity through complex point selection and complex network construction, thereby predicting the arrival time of ships in different segments. The complexity of the waterway conditions directly affects the speed and sailing time of the ship, so reasonable segmentation can significantly improve the accuracy of the prediction model. Complex points refer to track points on the waterway where the navigation conditions are relatively complex and have a significant impact on the ship's travel time. The identification of these points is achieved by calculating the comprehensive complexity score of each track point.
[0031] The calculation of the comprehensive complexity score is based on the physical properties and navigation conditions of the channel, including characteristics such as channel curvature, traffic volume, channel width and channel depth. These characteristics reflect the physical characteristics and navigation conditions of the channel and are normalized using MinMaxScaler before calculation. Specifically, channel curvature and traffic volume are processed using a standard normalization method to give values between 0 and 1; while channel width and water depth are reverse normalized because narrower channels and shallower water depths generally indicate higher complexity. The weight of each feature is determined by its score in the feature importance ranking. Based on these weighted and normalized feature data, the comprehensive complexity score of each track point is calculated. The higher the score, the greater the impact of the location on the ship's travel time.
[0032] After completing the complexity scoring, a complex network can be constructed: each track point in the AIS data is regarded as a node, the nodes are connected by edges, and the geographical distance between nodes is used as the weight of the edge. The expression for calculating the geographical distance between adjacent nodes is: ; Where, is the geographical distance between two track points; is the radius of the Earth; 、 are the latitudes of the two track points respectively; 、 are the longitudes of the two track points respectively.
[0033] These geographical distances are calculated using the longitude and latitude of the track points to accurately reflect the track structure. Adjacent points are connected by geographical distance and accurately segmented using the complexity information of the nodes. Each node is traversed one by one based on its complexity information, and the complexity between adjacent nodes is compared using a preset threshold. When the complexity difference between two adjacent nodes is within the preset threshold, they are classified into the same segment; otherwise, a new segment starts from the next node. Based on the construction of a complex network, the spatial relationship and complexity between track points are effectively captured. Segments are segmented using complexity scores to ensure that points with similar complexity are classified into the same segment. When the complexity score difference between two adjacent track points exceeds the set threshold, they are divided into different segments.
[0034] Step S4: annotate important features according to the results of the segment division, use the annotated important features to train the prediction model, and use the trained prediction model to achieve segmented prediction of the ship arrival time.
[0035] Specifically, to accurately predict ship arrival times at different voyage stages, this embodiment of the present invention constructs a segmented prediction model by combining a convolutional neural network (CNN), a long short-term memory network (LSTM), and the whale optimization algorithm (WOA). This model uses CNN to extract local features and LSTM to capture long-term dependencies in time series, thereby deeply exploring dynamic patterns during a ship's voyage. To further improve prediction accuracy and stability, the WOA algorithm is used to optimize key hyperparameters of the CNN-LSTM model.
[0036] There are four interacting layers inside the unit of LSTM model, namely the main layer and input gate , Forget Gate and output gate , its main function is to synthesize the feature vectors extracted by the model. The main layer is used to analyze the current input and the previous hidden state The role of the input gate Control and input new information; forget gate Control and retain new information and forget old information; output gate Control the output of information. 、 、 、 、 、 The calculation formula is as follows: ; ; ; ; ; ; Where, Represents the input of the model; Represents the memory state of the model; Represents the hidden state of the model; represents the weight matrix between the layer and each gate, Represents the weight matrix from input to main layer; Represents the weight matrix from the previous hidden state to the main layer; Represents the weight matrix input to the forget gate; Represents the weight matrix from the previous hidden state to the forget gate; Represents the weight matrix input to the input gate; The weight matrix representing the hidden state to the input gate; Represents the weight matrix from input to output gate; Represents the weight matrix from the previous hidden state to the output gate; Represents the corresponding bias term; Represents the bias term of the main layer; Represents the bias term of the forget gate; Represents the bias term of the input gate; Represents the bias term of the output gate; represents the tangent hyperbolic function; is the activation function sigmoid.
[0037] CNN is an important network structure in deep learning, widely used in fields such as image, video, and audio processing, and possesses powerful feature extraction capabilities. However, traditional CNNs have limited adaptive feature extraction capabilities when processing multi-source, high-dimensional data, and the selection of model parameters relies on multiple experiments and human experience, making the process time-consuming and complex. Furthermore, CNNs have poor generalization capabilities when processing data with strong temporal correlations. Therefore, the embodiments of the present invention utilize a CNN-LSTM model, combining the advantages of CNN and LSTM to overcome the shortcomings of a single CNN. The first component of the CNN-LSTM model is the CNN, consisting of convolutional and max pooling layers, responsible for preprocessing the raw data. The convolutional layer uses convolutional kernels to adaptively extract local features, generating a more expressive feature matrix; the max pooling layer uses dimensionality reduction to retain key features and avoid model overfitting. The pooled feature vector is input to the LSTM layer, which captures long-term dependencies in the time series, thereby enabling global trend prediction of ship arrival times.
[0038] For models involving hyperparameter selection, the choice of parameters has a significant impact on model accuracy. In this embodiment of the present invention, the Whale Optimization Algorithm (WOA) is used to optimize key hyperparameters of the CNN-LSTM model, such as the learning rate, the number of LSTM neurons, and the number of convolutional layer filters. WOA is a swarm intelligence optimization algorithm based on the hunting behavior of humpback whales. Its principles are simple and easy to understand, making it suitable for nonlinear optimization tasks. The algorithm has a small number of parameters, primarily including population size, number of iterations, and initial population position, and its calculation process is simple and efficient. Given sufficient computing resources, WOA can perform parallel optimization iterations for each population, significantly reducing computation time.
[0039] WOA uses a random or optimal search agent to simulate predation behavior, while also using a spiral model to simulate the humpback whale's bubble attack mechanism. The three core steps in the WOA algorithm correspond to the different stages of humpback whale hunting: random search, shrinking encirclement, and bubble attack.
[0040] Specifically, the WOA algorithm is used to optimize the key parameters in the prediction model, including the following steps: Step S421: Set the number of whales and the maximum number of iterations, and initialize the positions of all whales.
[0041] Step S422: Calculate the fitness of each whale, identify and retain the optimal whale position.
[0042] Step S423: Generate a random number ,like If the value is less than 0.5, then step S424 is executed. Otherwise, the bubble net predation mechanism is used to update the whale's position. That is, the distance between the whale's current position and the optimal position is calculated, and a spiral relationship based on the position is constructed. The whale uses its own position as the starting point and launches a spiral attack on the target: ; ; Where, A vector pointing to the optimal position for the whale's current position; is the current global optimal whale position; For the The whale position at the iteration; is a random number in the range [0,1]; is a constant; is a mathematical constant, is the exponential growth part, used to generate the spiral path.
[0043] Step S424: Calculate the coefficient vector of the algorithm ,like If the absolute value of is less than 1, the prey is surrounded and the whale's position is updated. Otherwise, a global random search for prey is performed and the whale's position is updated. After finding the target group, the individual whale conducts a local search for a single prey object and updates the whale's position with the prey's position. At the same time, all whales move closer to the global optimal position, thus surrounding the prey: ; ; Where, Current location of the whale and the global optimal solution position the distance between them; 、 is the coefficient vector.
[0044] When humpback whales are foraging, each whale randomly selects the location of the next whale and moves closer to it to update its own position. This results in a larger moving step length, a wider prey range, and a better global search effect of the algorithm. The expression for global random search of prey is: ; ; ; ; ; In the above formula, Current location of the whale With randomly selected positions the distance between them; is the next position of a randomly selected whale; For the The whale position at the iteration; is a random number uniformly distributed in the interval [0,1]; is a linear decay variable. As the number of iterations increases, Decays linearly from 2 to 0; is the current iteration number; is the maximum number of iterations.
[0045] Step S425: Calculate the fitness of each whale and compare it with the retained optimal whale position. If the current fitness is better, update the optimal solution.
[0046] Step S426: Determine whether the current number of iterations reaches the set maximum number of iterations. If so, the optimal solution is obtained; otherwise, return to step S423.
[0047] WOA uses global search capabilities to explore all potential parameter combinations, enabling the model to adapt to the complex conditions of different voyage segments and improving prediction accuracy and robustness. Dynamic parameter adjustment helps the CNN-LSTM converge quickly during training while avoiding overfitting and parameter redundancy. Furthermore, WOA reduces the time cost of hyperparameter search and improves tuning efficiency, providing a more stable and efficient solution for ship arrival time prediction models, ensuring the model's adaptability and predictive performance in changing navigation environments.
[0048] In order to comprehensively evaluate the prediction performance of the model, the embodiment of the present invention uses the root mean square error (RMSE), mean absolute error (MAE) and coefficient of determination (R²) as key error indicators. The calculation expressions of each indicator are: ; ; ; In the above formula, For the predicted values; For the True values; is the mean of all true values; is the sample size.
[0049] These metrics quantify the model's performance on both the training and test sets, providing accurate guidance for hyperparameter optimization. These error metrics are used as the fitness function of the WOA algorithm to evaluate model performance after each parameter optimization. Based on feedback from these error metrics, WOA adjusts the model's learning rate, number of LSTM neurons, and number of convolutional filters, ensuring that the CNN-LSTM model maintains high prediction accuracy under variable voyage conditions. This optimization process not only improves the model's overall robustness and accuracy, but also reduces parameter adjustment time, providing a reliable and efficient solution for ship arrival time prediction.
[0050] An embodiment of the present invention also provides a complex network-based ship arrival time segmentation prediction system, which is implemented based on the above-mentioned complex network-based ship arrival time segmentation prediction method, and includes: a data acquisition module, a feature engineering module, a complex network construction module, a segment division module, a model training and prediction module, and an evaluation and optimization module.
[0051] Data acquisition module: collects the position, speed and heading of the ship during navigation from the ship automatic identification system AIS, and obtains the channel curvature, water depth, width and ship flow in the water area as characteristic data.
[0052] Feature Engineering Module: Calculates the importance scores of all feature data, selects important features whose importance scores are greater than the set threshold, and eliminates irrelevant or less influential features.
[0053] Complex network construction module: Each track point in the AIS data is used as a node of a complex network. The nodes are connected by edges, and the geographical distance between nodes is set as the weight of the edge to construct a complex network.
[0054] Segment division module: The ship's navigation waters are divided into segments based on the complexity score and the set complexity threshold. When the difference in complexity scores between two adjacent nodes is greater than the set threshold, they are divided into different segments.
[0055] Model training and prediction module: The prediction model is trained using the important features of different sections, and the trained model is applied to actual prediction. Based on the input real-time ship data and channel information, the arrival time of the ship in different sections is predicted in sections and the prediction results are output.
[0056] Evaluation and Optimization Module: Calculates the root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²) between the actual and predicted arrival times of ships, evaluates the performance of the prediction model, and optimizes the feature engineering module, model training, and prediction module based on the evaluation results.
[0057] To validate the effectiveness of the proposed method, an experiment was conducted in a section of the Yangtze River, collecting AIS data from 58,424 ships between January and March 2023. Python 3.12 was used for data processing and model training. To more effectively identify complex waters and provide decision support for maritime regulatory authorities, the processed AIS data was classified into two categories: upstream and downstream. A vessel with the MMSI code 413940123 was randomly selected for segmented time of arrival prediction. The remaining data was used for model training.
[0058] In the data preprocessing stage, the Stacking algorithm is used to screen and sort the features, and the features with little influence or irrelevant to the ship arrival time prediction are eliminated. The results of the feature importance ranking are shown in Table 1.
[0059] Table 1 Feature importance ranking
[0060] As can be seen from Table 1, channel mileage, speed over ground, and course over ground are the three most important features for predicting ship arrival times. Channel mileage has the highest importance score, reflecting the direct impact of the distance between the ship's current position and the destination on the arrival time; speed over ground and course over ground describe the ship's motion state and also have a significant impact on the prediction. In addition, features such as channel depth, channel width, and traffic flow have lower scores, but still contribute to the model. These features reflect the physical properties and navigation conditions of the channel and have a certain auxiliary role in predicting the performance of ships in complex environments. Features such as ship width, length, deadweight tonnage, and navigation status have a score of 0, indicating that these features have no direct impact on the prediction of ship arrival time. These features will be eliminated to reduce the input dimension and training complexity of the model.
[0061] The stacking algorithm filters and sorts features, ensuring that the model only uses key features relevant to ship arrival time prediction. During feature fusion, the feature importance scores from LightGBM and XGBoost are combined, and weighted averaging and normalization are used to streamline the model input and make it more efficient. The selected features not only improve the model's computational efficiency and prediction accuracy, but also provide reliable data support for complex network modeling.
[0062] In experimental analysis, the rational selection of complex points is crucial for ensuring model performance in order to accurately predict ship arrival times at different voyages. These complex points are often located in areas with unique navigational conditions, such as dense traffic, narrow channels, or shallow water depths. Therefore, this paper screens and analyzes these complex points by combining feature data and weights. Through normalization and weighted calculations, the comprehensive contribution of different features to complexity is determined. To unify the dimensions of each feature, four physical features—channel curvature, vessel traffic volume, channel width, and channel depth—are normalized. The MinMaxScaler function is used to map each feature's value to the range [0, 1]. The normalized results of some features are inverted based on actual conditions to reflect their varying impact on complexity. For example, since areas with smaller channel widths and shallower water depths are more complex, the normalized values of these features are inverted to ensure that these areas are preferentially identified as complex points. In the experiment, each feature is assigned a different weight based on the feature importance ranking shown in Table 1 to accurately reflect its relative importance in complexity assessment. Finally, the complexity score of each track point is also mapped to the range of [0, 1] to distinguish different levels of complexity. Specifically, points with scores in the range of 0.9-1 are highly complex, points in the range of 0.8-0.9 are relatively complex, points in the range of 0.7-0.8 are moderately complex, and points with scores below 0.7 are considered relatively uncomplex. This division ensures the accurate screening of complex points and provides high-quality input data for subsequent model predictions. The final selection of complex points for the predicted ship is shown in the figure below. Figure 3 shown. Figure 3 The diagram shows the complexity of each track point within different sections, using markers of different shapes to intuitively reflect the complexity of the waterway. Stars in the diagram represent highly complex sections, typically located in shallow water, narrow channels, or areas with dense ship traffic, posing significant challenges to navigation. Triangles indicate areas where there may be some narrowing of the channel or changes in water flow, but these areas are slightly less complex than the most complex areas. Diamonds represent relatively complex sections, which, while not subject to extremely complex navigation conditions, still require ships to exercise caution when passing through them. Circular dots represent areas of lower complexity, typically with wider channels, deeper water depths, and less ship traffic, making them suitable for smooth passage. These complex points are typically located in narrow, shallow waters, or areas with high traffic volume, and these locations will become key nodes in the complex network. When segmenting the network, the location and density of these complex points can be used to more rationally divide the sections, ensuring that each section accurately reflects its complexity.
[0063] After obtaining the complexity of each track point, a complex network is constructed based on the trajectory data and complex point data, connecting adjacent points by geographic distance, and using the complexity information of the nodes for precise segmentation. The trajectory data and complex point data respectively contain information such as the latitude and longitude, MMSI, and timestamp of each track point, and assign a specific complexity score to the complex point. First, the MMSI and timestamp formats in the trajectory data and complex point data are unified to ensure smooth matching between the data. In the process of constructing the complex network, each track point is mapped to a node in the network, and the unique identifier of the node is composed of the MMSI and timestamp. For the nodes in the complex point data, their attributes in the network are updated using the complexity score. In order to preserve the spatial and sequential relationships between track points, edges are created for adjacent nodes based on geographic distance, and the geographic distance is used as the weight of the edge. This step ensures that the construction of the network structure can truly reflect the physical characteristics of the track and provides an important foundation for subsequent segmentation.
[0064] The complexity information of each node is traversed one by one, and the complexity between adjacent nodes is compared using a preset threshold. In the embodiment of the present invention, the threshold is set to 0.2. When the complexity difference between two adjacent nodes is within the preset threshold, they will be classified into the same segment; otherwise, a new segment will start from the next node. This method can ensure that areas with similar complexity are reasonably divided into one segment, avoiding the wrong splitting of similar areas. The final segmentation result is as follows: Figure 4 As shown, the entire waterway is divided into multiple sections, labeled Water Area 1 through Water Area 7. The complexity levels of each water area are: Water Area 1: 0.213771, Water Area 2: 0.345570, Water Area 3: 0.194457, Water Area 4: 0.557748, Water Area 5: 0.432217, Water Area 6: 0.662145, and Water Area 7: 0.172486. Each segment is generated through complex network analysis, quantifying the complex points in the waterway and their adjacent relationships. This segmentation clearly demonstrates the complexity of different sections, providing valuable support for subsequent ship arrival time prediction and management.
[0065] The Whale Optimization Algorithm (WOA) was used to optimize key hyperparameters of the Convolutional Long Short-Term Memory (CNN-LSTM) model, such as the learning rate, the number of LSTM neurons, and the number of convolutional filters. This optimization process simulates the hunting behavior of whales to find the optimal parameter combination for the model in complex waters, ensuring high accuracy and adaptability of the prediction model. The WOA algorithm's initial stage randomly initializes a population of solutions in the parameter space, representing different parameter combinations. Each solution consists of three parameters: the learning rate, the number of LSTM neurons, and the number of convolutional filters. The initial range of the learning rate was 0.000001–0.10, the number of LSTM neurons was set between 10 and 1000, and the number of convolutional filters was set between 16 and 128. By combining these parameters, the performance of the CNN-LSTM model under different conditions was explored. The optimized results yielded an optimal learning rate of 0.0000384350, an optimal number of LSTM neurons of 213, and an optimal number of convolutional filters of 33.
[0066] In order to verify the superiority of the model, a comparative experiment was designed to train LSTM, CNN, CNN-LSTM and WOA-CNN-LSTM models respectively, and compare the prediction results of each model with the actual value on the test set. The results are as follows: Figure 5 and Figure 6 The comprehensive error results are shown in Table 2.
[0067] Table 2 Comparison of comprehensive error results of each model
[0068] Comparative experimental results show that the WOA-CNN-LSTM model outperforms other models across all error metrics, fully demonstrating its superior predictive capabilities under complex voyage conditions. Among all models, the WOA-CNN-LSTM model achieved an R² value of 0.994, closer to 1, indicating excellent fit for ship arrival times. Its RMSE and MAE values were also significantly lower than those of other models, demonstrating lower prediction errors. In contrast, the CNN-LSTM model without WOA optimization, while capable of processing time series, lacked systematic hyperparameter optimization, resulting in an RMSE of 6.334 and an R² of 0.989, slightly inferior to the WOA-optimized model. Both the LSTM and CNN models exhibited relatively high errors due to their respective limitations in capturing local data features or temporal dependencies. The CNN model, in particular, achieved an RMSE of 7.334, demonstrating that convolutional networks alone cannot adequately capture these features.
[0069] This paper proposes a ship arrival time prediction model based on WOA-CNN-LSTM. This model combines the advantages of convolutional neural networks (CNNs) and long short-term memory networks (LSTMs), efficiently extracting local features and capturing long-term dependencies in time series. The CNN layer extracts local features from the voyage data, providing a solid foundation for the LSTM layer's time series processing. The LSTM layer, on the other hand, focuses on capturing long-term dependencies in the time series, thereby achieving accurate predictions of ship arrival times. Furthermore, the Whale Optimization Algorithm (WOA) is introduced to optimize the model's hyperparameters. By simulating the feeding behavior of whales, WOA explores the optimal hyperparameter combination, ensuring rapid model convergence during training and effectively avoiding overfitting. This optimization strategy not only improves the model's prediction accuracy but also enhances its adaptability to different voyage conditions.
[0070] Comparative experiments verified its superior performance under complex voyage conditions. The WOA-CNN-LSTM model significantly outperformed other models on the test set, becoming the preferred choice for ship arrival time prediction under complex voyage conditions. The experimental results demonstrate that the WOA algorithm offers significant advantages in hyperparameter optimization, effectively improving model performance. This model not only provides a new solution for arrival time prediction in the shipping industry but also demonstrates the potential of the WOA algorithm for optimizing hyperparameters in complex models.
[0071] The technical features of the above embodiments may be combined in any manner. To simplify the description, not all possible combinations of the technical features in the above embodiments are described. Only preferred embodiments of the present invention are presented. While the description is relatively specific and detailed, it should not be construed as limiting the scope of the present invention. As long as there are no conflicts in the combination of these technical features, they should be considered to be within the scope of this specification.
[0072] It should be noted that, for those skilled in the art, various modifications and improvements can be made without departing from the scope of the present invention, and these modifications and improvements fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A segmented prediction method for ship arrival time based on complex networks, characterized in that: The following steps are involved: Step S1: The ship's AIS data, channel characteristics, and traffic environment characteristics are used as feature data, and the importance scores of all feature data are calculated. Feature data with an importance score greater than a set importance threshold is regarded as an important feature; Step S2: weighting the important features according to the importance scores to obtain a complexity score for each track point in the AIS data; Step S3: Traverse all track points. If the difference between the complexity scores of two adjacent track points is less than the set threshold, the two track points are divided into the same segment, otherwise they are divided into different segments. Step S4: annotate important features according to the results of the segment division, use the annotated important features to train the prediction model, and use the trained prediction model to achieve segmented prediction of the ship arrival time.
2. The method for predicting ship arrival time by segment based on complex network according to claim 1, characterized in that: Calculating the importance scores of all feature data in step S1 includes the following steps: Step S11: Train the lightweight gradient boosting machine LightGBM and the extreme gradient boosting XGBoost model respectively. The LightGBM and XGBoost models calculate the importance score of each feature data through the node splitting gain in the decision tree: ; Where, It is a feature Importance score; Contains features The number of decision trees; It is In a decision tree, the features The gains from partitioning nodes; Step S12: Perform weighted fusion on the importance scores of each feature calculated by the LightGBM and XGBoost models: ; Where, Features The comprehensive importance score of 、 are the weights of LightGBM and XGBoost models respectively; Features Importance score in LightGBM model; Features Importance score in XGBoost model; Step S13: Standardize the importance score of each feature: ; Where, is the raw feature importance score; is the minimum value among all feature scores; is the maximum value among all feature scores; is the normalized feature importance score.
3. The method for predicting ship arrival time by segment based on complex network according to claim 1, characterized in that: The characteristic data in step S1 also includes the channel mileage, which is obtained by calculating the geographical distance between nodes. The expression for calculating the geographical distance between nodes is: ; Where, is the geographical distance between two track points; is the radius of the Earth; 、 are the latitudes of the two track points respectively; 、 are the longitudes of the two track points respectively.
4. The method for predicting ship arrival time by segment based on complex network according to claim 1, characterized in that: The step S4 uses the annotated important features to train the prediction model, including the following steps: Step S41: using the local feature extraction module in the prediction model to extract local features from the important features, using the time series feature extraction module in the prediction model to extract time series features from the local features, and using the local features and time series features to predict the arrival time of the ship; Step S42: Optimize the parameters of the local feature extraction module and the temporal feature extraction module using the whale algorithm (WOA).
5. The method for predicting ship arrival time by segment based on complex network according to claim 4, characterized in that: Step S42 includes the following steps: Step S421: Set the number of whales and the maximum number of iterations, and initialize the positions of all whales; Step S422: Calculate the fitness of each whale, identify and retain the optimal whale position; Step S423: Generate a random number ,like If it is less than 0.5, then step S424 is executed; otherwise, the bubble net predation mechanism is used to update the whale's position; Step S424: Calculate the coefficient vector of the algorithm ,like If the absolute value of is less than 1, the prey is surrounded and the whale's position is updated. Otherwise, the prey is searched randomly globally and the whale's position is updated. Step S425: Calculate the fitness of each whale and compare it with the retained optimal whale position. If the current fitness is better, update the optimal solution. Step S426: Determine whether the current number of iterations reaches the set maximum number of iterations. If so, the optimal solution is obtained; otherwise, return to step S423.
6. The method for predicting ship arrival time by segment based on complex network according to claim 5, characterized in that: The expression of the bubble net predation mechanism in step S423 is: ; ; Where, A vector pointing to the optimal position for the whale's current position; is the current global optimal whale position; For the The whale position at the iteration; is a random number; is a constant; is a mathematical constant.
7. The method for predicting ship arrival time by segment based on complex network according to claim 5, characterized in that: The expression for surrounding the prey in step S424 is: ; ; Where, Current location of the whale and the global optimal solution position the distance between them; is the coefficient vector; is the current global optimal whale position; For the The whale position at the iteration; is the coefficient vector.
8. The method for predicting ship arrival time by segment based on complex network according to claim 5, characterized in that: The expression for the global random search for prey in step S424 is: ; ; ; ; ; In the above formula, Current location of the whale With randomly selected positions the distance between them; 、 is the coefficient vector; is the next position of a randomly selected whale; For the The whale position at the iteration; is a random number in the interval [0,1]; is a linear decay variable; is the current iteration number; is the maximum number of iterations.
9. A complex network-based ship arrival time segmentation prediction system, implemented based on a complex network-based ship arrival time segmentation prediction method according to any one of claims 1 to 8, characterized in that: include: Data collection module, feature engineering module, flight segment division module, model training and prediction module; The data acquisition module collects the position, speed and heading of the ship during navigation from the ship automatic identification system AIS, and obtains the channel curvature, water depth, width and ship flow in the water area as characteristic data; The feature engineering module calculates the importance scores of all feature data, selects important features with importance scores greater than a set threshold, and eliminates irrelevant or less influential features; The segment division module divides the navigation waters of the ship into segments according to the complexity score and the set complexity threshold. When the difference in complexity score between two adjacent nodes is greater than the set threshold, they are divided into different segments. The model training and prediction module uses the important features of different sections to train the prediction model, applies the trained model to actual prediction, and predicts the arrival time of ships in different sections according to the input real-time ship data and channel information, and outputs the prediction results.
10. The complex network-based ship arrival time segment prediction system according to claim 9, characterized in that: The system also includes an evaluation and optimization module, which calculates the root mean square error (RMSE), mean absolute error (MAE) and determination coefficient (R²) between the actual arrival time and the predicted arrival time of the ship, evaluates the performance of the prediction model, and optimizes the feature engineering module and the model training and prediction module based on the evaluation results.
Citation Information
Cited By
Ship type identification method and device based on motion features of track point set
CN121479529A