Ship arrival time high-precision prediction method and device based on long and short time neural network, and storage medium
By constructing a method based on long short-term neural networks and combining feature selection and model training with multi-source data, the problems of dynamic changes and multi-source data fusion in ship arrival time prediction are solved, achieving high-precision and real-time prediction results, which are applicable to port scheduling and shipping management.
Patent Information
- Application Number
- CN202511143429.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-11-28
AI Technical Summary
Existing methods for predicting ship arrival times are insufficient in taking into account dynamic changes during the voyage, especially in ocean routes or complex sea areas where prediction errors are large. Furthermore, they lack the ability to integrate multi-source data and update in real time, making it difficult to meet the needs of intelligent port operations.
A method based on long short-term neural networks is adopted. By aligning AIS data and nautical log data in time and space, and combining meteorological data for time and space interpolation fusion, feature selection and model training are performed to construct a bidirectional long short-term memory network, and an attention mechanism is introduced for prediction.
It significantly improves the accuracy and real-time performance of ship arrival time prediction, enabling more accurate characterization of ship movement patterns and meeting the high-precision requirements of port scheduling and shipping management.
Smart Images

Figure CN121031867A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent shipping and transportation information technology, and in particular to a method, device, and storage medium for high-precision prediction of ship arrival time based on long short-time neural networks. Background Technology
[0002] As the primary mode of transportation in global trade, maritime transport carries the majority of international cargo. Ports, as crucial nodes connecting sea and land, directly impact the efficiency of the entire supply chain. Estimated Time of Arrival (ETA), a key indicator for port scheduling and resource allocation, is critical for improving berth utilization, alleviating congestion, and optimizing operational processes.
[0003] Most existing ETA prediction methods rely on static estimations based on distance and average speed, failing to effectively account for dynamic changes during navigation. This is especially problematic for long-haul routes or complex sea areas, resulting in significant prediction errors. Some studies have introduced machine learning methods or AIS trajectory analysis to improve accuracy, but these generally suffer from weak model adaptability and poor real-time update capabilities, making it difficult to meet the demands of high-frequency prediction.
[0004] The widespread application of AIS systems provides a data foundation for acquiring ship dynamic information, making data-driven ETA prediction possible. However, AIS data often suffers from missing, delayed, and redundant data, and without an effective data processing mechanism, direct modeling is unlikely to achieve ideal results. Furthermore, ship speed is significantly affected by meteorological factors such as wind speed and air pressure, further increasing the difficulty of prediction. Traditional modeling methods, such as linear regression, struggle to handle the long-term and nonlinear characteristics of navigation data. Although deep learning models such as LSTM have achieved some success in time-series modeling, they still have shortcomings in multi-source data fusion, prediction accuracy, and real-time performance.
[0005] Therefore, there is an urgent need for a ship ETA prediction method that can effectively integrate multi-source heterogeneous data and has high accuracy and real-time performance to meet the actual needs of intelligent port operation. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the existing technology and provide a high-precision prediction method, device and storage medium for ship arrival time based on long short-term memory neural network. By comprehensively utilizing long short-term memory network (LSTM) and attention mechanism, it achieves high-precision and real-time prediction of ship ETA, which can be widely used in port scheduling, shipping management and intelligent logistics and other scenarios.
[0007] The objective of this invention can be achieved through the following technical solutions:
[0008] The first aspect of this invention provides a high-precision prediction method for ship arrival time based on long short-time neural networks, comprising the following steps:
[0009] Spatiotemporal alignment of AIS data and nautical log data is performed. Speed and position statistics are generated by aggregating AIS data. Within a preset time window, nautical log records are matched and the fused speed is calculated.
[0010] Meteorological parameters are obtained by spatiotemporal interpolation and fusion of meteorological data based on the ship's position, and missing values are filled and the coding is standardized for the ship's static information.
[0011] The fused flight speed, meteorological parameters, and static information obtained after processing are synchronously constructed into time-series samples according to a unified time axis, and the time-series samples are subjected to trajectory segmentation and smoothing.
[0012] By using recursive feature elimination and cross-validation, the optimal feature subset is iteratively selected from spatial features, meteorological features, temporal features, and ship dynamic and static features;
[0013] Using the optimal feature subset as input features, a bidirectional long short-term memory network is constructed, and the model is trained based on the processed time-series samples corresponding to the optimal feature subset. Based on the trained bidirectional long short-term memory network, the ship arrival time prediction is realized.
[0014] Furthermore, the process of aligning AIS data and nautical log data in time and space, generating speed and position statistics by aggregating AIS data, and matching nautical log records within a preset time window to calculate the fused speed includes:
[0015] AIS data is aggregated at the hourly granularity to calculate the median airspeed and average latitude and longitude of AIS within that hour;
[0016] Using the hourly records in the nautical log as the center, a sliding time window is set to calculate the spatial distance between the log record and the AIS aggregation point. If the distance is less than the set threshold, the match is considered successful.
[0017] For the hourly records in the matching nautical log, the weighted average of the AIS median speed and the nautical log speed is used as the fused speed, and the corresponding average latitude and longitude is used as the unified position reference at that moment, thus completing the spatiotemporal alignment and speed fusion.
[0018] Furthermore, the specific process of obtaining meteorological parameters by spatiotemporal interpolation and fusion of meteorological data based on ship positions includes:
[0019] Using the ship's current latitude and longitude as the center, select the nearest meteorological grid point in the vicinity, and use the inverse distance weighting method to calculate wind speed, wind direction, and wave height;
[0020] If the ship's time point falls between two full hours, then linear interpolation is performed using meteorological data from adjacent full hours to obtain continuous meteorological parameters.
[0021] Furthermore, the specific process of performing missing value completion and coding standardization on ship static information includes:
[0022] For the missing MMSI field in AIS, fuzzy matching is used to complete it by IMO number or ship name string, the ship tonnage unit is unified, and the ship type field is uniquely coded.
[0023] The completed ship static information is mapped to the corresponding time step, achieving standardized alignment of meteorological, dynamic, and static data on the same time axis.
[0024] Furthermore, the fused flight speed, meteorological parameters, and static information obtained after processing are synchronously constructed into time-series samples according to a unified time axis. The specific process of trajectory segmentation and smoothing of the time-series samples includes:
[0025] At hourly intervals, the fused flight speed, meteorological parameters, and completed static information are uniformly filled into the continuous time axis to generate time-series samples with equal intervals and no gaps.
[0026] Based on the location points where the speed is below the parking threshold or the destination information changes, the continuous trajectory is divided into independent segments, so that each segment reflects a complete navigation intention;
[0027] For each independent flight segment, a recursive filtering algorithm is used to estimate and update the smooth values of latitude, longitude, speed, and heading in sequence to eliminate observation noise and instantaneous jitter, and output a continuous and smooth trajectory sequence.
[0028] Furthermore, the specific process of iteratively selecting the optimal feature subset from spatial features, meteorological features, temporal features, and ship dynamic and static features using recursive feature elimination and cross-validation includes:
[0029] The specific process of iteratively selecting the optimal feature subset from spatial features, meteorological features, temporal features, and ship dynamic and static features using recursive feature elimination and cross-validation includes:
[0030] All initial spatial features, meteorological features, temporal features, and ship dynamic and static features are combined into a high-dimensional dataset. Based on the weights of the regression model, the features with the smallest weights are eliminated round by round.
[0031] After each round of elimination, K-fold cross-validation is used to evaluate the prediction error, and the average performance is recorded as the evaluation of the feature combination in that round.
[0032] The process is repeated until the remaining features no longer improve performance in K-fold cross-validation. Finally, the spatial features, meteorological features, temporal features, and ship dynamic and static features with the highest evaluated contribution are retained to form the optimal feature subset.
[0033] Furthermore, the specific process of constructing a bidirectional long short-term memory network using the optimal feature subset as input features, and training the model based on the processed time-series samples corresponding to the optimal feature subset includes:
[0034] The time-series samples after trajectory segmentation and smoothing are divided into training set, validation set, and test set;
[0035] For each time series sample, only the channel data corresponding to the optimal feature subset is retained to form a simplified multidimensional input sequence;
[0036] A network structure containing a bidirectional long short-term memory layer is constructed, including: first capturing historical dependencies with a forward-order input sequence, then capturing future constraints with a reverse-order input sequence, and concatenating the two hidden states into a composite feature vector. After the bidirectional long short-term memory layer, an attention layer and a random deactivation layer are connected in sequence. The attention layer weights and aggregates the output of historical periods according to the current hidden state, and the random deactivation layer suppresses overfitting.
[0037] The mean squared error loss function is used, and the network parameters are iteratively updated through the backpropagation algorithm. During the training process, the validation set error is used for early stopping control until the model performance converges on the validation set.
[0038] Finally, the optimal network weights are saved, and the predicted ship arrival times are output on the test set.
[0039] Furthermore, the specific process of constructing the network structure including a bidirectional long short-term memory layer includes:
[0040] First, the input features are read along the forward and backward time directions in the first layer of bidirectional long short-term memory unit to capture the backward constraints of the ship's future voyage on the current state and the forward dependence of the historical voyage on the current state, and output the forward and backward hidden states.
[0041] The splicing state output from the first layer is fed into the second layer bidirectional long short-term memory unit for bidirectional encoding again to extract deeper spatiotemporal motion patterns.
[0042] A random deactivation layer is inserted between two layers of bidirectional long short-term memory units to temporarily block neuronal connections according to a set probability, thereby improving the model's generalization ability.
[0043] The bidirectional state sequence output from the second layer is input into the attention layer, and weights are dynamically allocated based on the similarity between the current decoding step and the historical steps, highlighting the key sailing periods that affect the arrival time.
[0044] The weighted high-dimensional representation is mapped into a fully connected layer to a single-step arrival time prediction value, thus completing the construction of a network structure for high-precision ETA estimation.
[0045] Furthermore, a bidirectional long short-term memory (BiLSTM) network is used to model the ship trajectory sequence. The BiLSTM operation formula is as follows:
[0046]
[0047] In equation (1), LSTM f Represented as forward pass, LSTM b Indicated as backward, For the output of the forward hidden layer, For the output of the backward hidden layer, x t For the input time, h t Depend on and It was pieced together.
[0048] The input sequences of the LSTM subnetworks in both directions of the BiLSTM structure are processed in both forward and reverse order. In the forward path, ship history features are input sequentially from the beginning to the end of the sequence to generate the forward hidden state; in the reverse path, the same sequence is input in reverse order from the end to the beginning of the sequence to generate the reverse hidden state. The forward and reverse hidden states at each time step are concatenated to form a composite vector as the final output of the model.
[0049] The input to BiLSTM includes temporal features such as speed, heading, position, and time. The model can simultaneously capture the bidirectional influence of past navigation states and future segment constraints on the current state, making it suitable for modeling ship trajectory sequences with long-range dependencies.
[0050] During model training, the parameters of the forward and backward LSTMs are set to be shared or independent, and a multi-layer stacked structure is adopted to enhance the model's expressive power. The mean squared error (MSE) is used as the loss function, and the parameters are optimized through the backpropagation algorithm.
[0051] Furthermore, the computational process of the attention mechanism includes the following steps:
[0052] 1) Calculate the similarity between the query vector Q at the current time step and the key vector K at historical time steps using the scaling dot product formula:
[0053]
[0054] Where V is the value vector, d k is the dimension of the key vector.
[0055] 2) Use the softmax function to normalize the similarity results to obtain the attention weights at each time step.
[0056] 3) Multiply each value vector by its corresponding weight and sum them up, and output the weighted representation of that time step.
[0057] In this method, the query matrix Q is taken from the hidden state of the LSTM at the current time step, and the key matrix K and value matrix V are both composed of the hidden states of the past 12 time steps (i.e., the past 6 hours).
[0058] S10: Introduce Dropout regularization. A Dropout layer is inserted between the LSTM layer and the attention layer to control the proportion of neurons inactivated in different layers. A Dropout layer is inserted after the first LSTM layer with a dropout rate of 0.3; a Dropout layer is inserted before the attention mechanism with a dropout rate of 0.5.
[0059] A second aspect of the present invention provides an electronic device, including a memory and a processor, wherein the processor is used to execute a program in the memory to realize the high-precision prediction method for ship arrival time based on long short-time neural networks as described above.
[0060] A third aspect of the present invention provides a storage medium, wherein the storage medium containing computer-executable instructions, when executed by a computer processor, is used to execute the above-described high-precision prediction method for ship arrival time based on a long short-time neural network.
[0061] Compared with the prior art, the present invention has the following beneficial effects:
[0062] (1) This invention constructs a time series sample that integrates AIS data, nautical log, meteorological information and ship static attributes, and uses a bidirectional long short-term memory network model to perform bidirectional time series modeling of ship trajectory, which significantly improves the model's ability to capture the future navigation status of ships and significantly improves the accuracy of ship arrival time prediction.
[0063] (2) This invention introduces an attention mechanism based on scaling dot product on the basis of bidirectional long short-term memory network model, which can dynamically allocate weights according to the importance of different time steps, effectively solve the problem of long sequence dependency decay, and improve the robustness and adaptability of the model in complex environments.
[0064] (3) This invention ensures that the input samples have good spatiotemporal continuity and feature representativeness by standardizing and aligning multi-source data, combined with trajectory segmentation, smoothing and feature selection mechanisms. It also improves the deep feature extraction capability through a multi-layer stacked structure, enabling the model to more accurately depict the laws of ship motion.
[0065] (4) The prediction results of this invention meet the high requirements of ETA (Estimated Time of Arrival) accuracy in practical application scenarios such as port scheduling and shipping logistics. Especially in near-port pilotage and berth scheduling, it can help achieve more reasonable resource allocation and efficiency optimization, and has practical engineering application value. Attached Figure Description
[0066] Figure 1 A flowchart illustrating a high-precision prediction method for ship arrival time based on a long short-time neural network provided by this invention;
[0067] Figure 2 The comparison between the predicted and actual values of ship arrival time in the high-precision prediction method for ship arrival time based on long short-time neural network provided by the present invention. Detailed Implementation
[0068] Overall, this invention provides a deep learning-based method for predicting ship arrival times. This method integrates AIS data, nautical logs, meteorological information, and ship static attributes. Through data alignment, cleaning, trajectory segmentation, and Kalman filtering, it constructs a unified standard time-series input sample. In the modeling stage, a Bidirectional Long Short-Term Memory (BiLSTM) network is used to extract temporal features from the trajectory sequence, and a scaling dot product-based attention mechanism is introduced to dynamically weight key time steps. Simultaneously, a Dropout mechanism is used to prevent overfitting and improve generalization ability. Key input features are selected through recursive feature elimination and cross-validation methods, combined with reasonable parameter settings and training strategies, to achieve high-precision prediction of ship arrival times. This method features strong modeling capabilities, high adaptability, and excellent prediction accuracy, and can be widely applied to port scheduling, shipping management, and intelligent logistics scenarios.
[0069] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. Component models, material names, connection structures, circuit structures, control methods, algorithms, and other features not explicitly described in this technical solution are considered common technical features disclosed in the prior art.
[0070] Example 1
[0071] This embodiment presents a high-precision prediction method for ship arrival times based on long short-time neural networks, such as... Figure 1 As shown, it includes the following steps:
[0072] S1: Align AIS data with nautical log data. Aggregate AIS data in hourly increments, calculating the median speed and average latitude and longitude for each hour. For hourly records in the nautical log, use a ±5 minute sliding time window for matching, calculating the spatial Euclidean distance between the AIS and log records. If the distance is less than 1 nautical mile, the location is considered a successful match. For matched records, generate a fused speed field, taking the weighted average of the speeds from AIS and the nautical log.
[0073] S2: Spatiotemporal matching of meteorological data. Meteorological data is provided with a spatial resolution of 0.5 degrees × 0.5 degrees and a 1-hour time interval. Based on the ship's latitude and longitude position, the four nearest meteorological grid points are selected, and the inverse distance weighting method is used to calculate the wind speed, wind direction, wave height, etc., of the target point. If the ship's data time point is not at the hour, linear interpolation is performed using the meteorological values of two adjacent hours to obtain the estimated meteorological parameters.
[0074] S3: Complete the ship's static data. For records in AIS that are missing MMSI, perform fuzzy matching using the IMO number or ship name. After a successful match, standardize the unit of ship tonnage and perform one-hot encoding on the ship type field.
[0075] S4: Perform time-series alignment. Using 1-hour time units, fill the processed AIS trajectory data, meteorological data, and static information onto a unified time axis to construct a standardized time-series input sample.
[0076] S5: Perform data cleaning, including the following operations:
[0077] 1) Handling missing values. For time-series data such as position and speed, linear interpolation is used for imputation. For records with missing MMSI in static information, they are marked and then deleted to ensure the uniqueness of ship identification and the availability of data.
[0078] 2) Detect and delete outliers. Location anomalies include latitude and longitude falling within land areas or exhibiting jump-like trajectories; speed anomalies refer to speeds exceeding 30 knots; and heading anomalies refer to sudden changes exceeding 90 degrees within a short period. All such anomaly records are deleted after being marked.
[0079] 3) Deduplicat data. By comparing timestamps with message content, redundant records that are completely identical are deleted, and only one record is retained. For multiple data reports submitted by the same vessel in a very short period of time, the record with the most recent time is retained.
[0080] S6: Perform trajectory processing, including two steps: trajectory segmentation and trajectory smoothing.
[0081] 1) Perform trajectory segmentation. Based on the ship's speed and destination information, divide the continuous trajectory into independent segments. When the ship's speed is less than 1 knot, it is considered to be in a berthing state, and the trajectory is segmented according to the time before and after berthing; when the ship's destination information changes, the trajectory is segmented according to the point of change.
[0082] 2) Trajectory smoothing is performed. A Kalman filter algorithm is used to denoise the latitude, longitude, speed, and heading data in the ship's trajectory. An initial state estimate and covariance matrix are set, and the state prediction and uncertainty are calculated based on the motion model. Then, combined with actual observations, the Kalman gain is calculated, the predicted and observed values are fused, and the state estimate is updated. This process is iterated recursively, ultimately outputting a smooth trajectory sequence.
[0083] The mechanism of the above steps lies in using spatiotemporal consistency as the axis, information integrity as the network, and noise suppression as the blade to transform multi-source heterogeneous original messages into continuous, reliable, and low-noise ship trajectory sequences that can be directly used for deep learning modeling. S1-S2 solves the inherent problems of sparse ship observations and lack of external disturbances through "dual-source dynamic benchmarks + meteorological field interpolation": AIS is high-frequency but has error drift, while nautical logs are low-frequency but have reliable positioning. After hourly aggregation and sliding window spatial matching, the two are fused with weighted speed to achieve complementary advantages; meteorological data is weighted by inverse distance of real-time ship coordinates and linearly interpolated to make discrete grid points of wind and waves continuous, ensuring that each trajectory point carries synchronous environmental disturbances, and introducing interpretable external driving forces for subsequent modeling. S3-S4 eliminates ambiguity in identity and measurement through "static completion + temporal alignment": IMO / ship name fuzzy matching completes MMSI, unifying tonnage units and ship type codes to ensure unique ship identity and quantifiable attributes; then, it fills along a unified hour axis to form a seamless temporal matrix, making dynamic, meteorological, and static information completely aligned in granularity, coordinates, and units, laying the foundation for the spatiotemporal isomorphism of subsequent algorithm inputs. S5-S6 uses a four-level purification mechanism of "anomaly removal - deduplication - trajectory segmentation - filtering and smoothing" to mark and delete common land drift, overspeed jumps, abrupt changes in heading, and redundant messages in the original messages one by one, and completes logical segmentation with speed thresholds and destination change points to ensure that each trajectory segment corresponds to a complete navigation intention; Kalman filtering recursively fuses observations and predictions under the constraints of the motion model, preserving the ship's real maneuver characteristics while significantly suppressing observation noise and instantaneous jitter, and finally outputting a continuous, smooth, and physically consistent trajectory sequence.
[0084] S7: Perform feature selection. The Recursive Feature Elimination and Cross-Validation (RFECV) method is used to select the optimal feature subset from the high-dimensional feature set.
[0085] 1) Construct a dataset containing all initial features, and use a recursive feature elimination method to gradually remove the features with the smallest weights according to model parameters (such as the absolute value of linear regression coefficients). Perform cross-validation evaluation after each set of features is removed.
[0086] 2) Cross-validation employs a K-fold partitioning strategy, training and testing each fold separately, and recording model performance metrics, including classification accuracy and mean squared error. The average performance across multiple rounds of validation is used as the evaluation result for the current feature combination.
[0087] 3) Iterative feature removal and performance evaluation are performed to finally determine spatial coordinates (longitude, latitude), meteorological parameters (wind speed, wind direction, temperature), time characteristics (date, hour), and ship dynamic and static information as the main input variables.
[0088] S8: Construct a prediction model. A bidirectional long short-term memory (BiLSTM) network is used to model the ship trajectory sequence. The BiLSTM operation formula is as follows:
[0089]
[0090] In equation (1), LSTM f Represented as forward pass, LSTM b Indicated as backward, For the output of the forward hidden layer, For the output of the backward hidden layer, x t For the input time, h t Depend on and It was pieced together.
[0091] The input sequences of the LSTM subnetworks in both directions of the BiLSTM structure are processed in both forward and reverse order. In the forward path, ship history features are input sequentially from the beginning to the end of the sequence to generate the forward hidden state; in the reverse path, the same sequence is input in reverse order from the end to the beginning of the sequence to generate the reverse hidden state. The forward and reverse hidden states at each time step are concatenated to form a composite vector as the final output of the model.
[0092] The input to BiLSTM includes temporal features such as speed, heading, position, and time. The model can simultaneously capture the bidirectional influence of past navigation states and future segment constraints on the current state, making it suitable for modeling ship trajectory sequences with long-range dependencies.
[0093] During model training, the parameters of the forward and backward LSTMs are set to be shared or independent, and a multi-layer stacked structure is adopted to enhance the model's expressive power. The mean squared error (MSE) is used as the loss function, and the parameters are optimized through the backpropagation algorithm.
[0094] S9: Introducing an attention mechanism. The method used is an attention mechanism based on scaled dot products, combined with LSTM output to dynamically adjust information weights.
[0095] The computational process of the attention mechanism includes the following steps:
[0096] 2) Calculate the similarity between the query vector Q at the current time step and the key vector K at historical time steps using the scaling dot product formula:
[0097]
[0098] Where V is the value vector, d k is the dimension of the key vector.
[0099] 4) Use the softmax function to normalize the similarity results to obtain the attention weights at each time step.
[0100] 5) Multiply each value vector by its corresponding weight and sum them up, outputting the weighted representation of that time step.
[0101] In this method, the query matrix Q is taken from the hidden state of the LSTM at the current time step, and the key matrix K and value matrix V are both composed of the hidden states of the past 12 time steps (i.e., the past 6 hours).
[0102] S10: Introduce Dropout regularization. A Dropout layer is inserted between the LSTM layer and the attention layer to control the proportion of neurons inactivated in different layers. A Dropout layer is inserted after the first LSTM layer with a dropout rate of 0.3; a Dropout layer is inserted before the attention mechanism with a dropout rate of 0.5.
[0103] S11: Perform dataset partitioning and model parameter setting.
[0104] The original dataset was randomly divided into training and testing sets in an 8:2 ratio, with 80% used for training and 20% for testing. The model architecture employed a two-layer LSTM network with 256 hidden units per layer. The training run consisted of 50 epochs with a batch size of 512 and a learning rate of 0.0005. These parameters were obtained through experimental verification and grid search optimization, satisfying the requirements for model training convergence and prediction accuracy.
[0105] Finally, the continuous time-series samples, after trajectory segmentation and Kalman filtering smoothing, are input into the trained bidirectional long short-term memory network in real time according to the optimal feature subset. The network first captures the historical navigation state with forward encoding and captures the future constraints with reverse encoding. It dynamically weights and aggregates the hidden states of the past few hours through an attention mechanism, and then maps and outputs the remaining navigation time to the destination port through a fully connected layer. The prediction results are updated on a rolling basis each time a new AIS message arrives until the ship arrives at the port.
[0106] At the data level, this invention addresses the long-standing shortcomings in Time of Arrival (ETA) prediction, namely "high data noise, numerous dynamic factors, and difficulty in capturing long-range dependencies," by proposing an end-to-end technical approach of "alignment-completion-cleaning-modeling-weighting." First, in the data alignment stage, hourly aggregation and sliding window matching are used to precisely stitch together high-frequency but fragmented AIS messages and low-frequency but reliable nautical logs in the spatiotemporal dimension, eliminating single-source errors while preserving complementary information. Then, inverse distance weighting and linear interpolation are used to make the discrete gridded meteorological data continuous, filling in the timeline synchronized with ship trajectories, thus solving the problem of traditional methods neglecting the impact of real-time wind and waves. Addressing common issues in AIS such as missing MMSI, inconsistent tonnage units, and uncoded ship types, the invention employs an IMO-ship name fuzzy matching strategy combined with one-hot coding to ensure the consistency and interpretability of static attributes. During the data cleaning stage, the combined speed-heading anomaly detection and Kalman filtering smoothing were used to eliminate anomalies such as land drift and message jumps while preserving the ship's true maneuvering characteristics, providing low-noise and highly continuous input for subsequent models.
[0107] At the model level, the invention uses a bidirectional long short-term memory network as its core. Through a dual-encoding mechanism, it explicitly characterizes the coupled impact of a ship's past navigation status and future navigation constraints on the current ETA, overcoming the limitation of traditional unidirectional networks that can only review history. To further address the issue of information from key time periods being diluted by averaging in long sequences, an attention mechanism based on scaling dot products is introduced. This allows the model to automatically focus on the historical segments that have the greatest impact on the remaining voyage at each prediction step, significantly improving robustness under complex waterways or sudden weather conditions. A random deactivation layer inserted between the memory unit and the attention layer temporarily shields some neurons, suppressing the overfitting tendency of deep networks and ensuring the model maintains high generalization ability even in real-world scenarios with busy ports and diverse shipping routes. The entire process follows a four-level progressive approach of "data-feature-model-regularization," progressively reducing noise and refining the data to ultimately output a high-precision ETA with real-time update capabilities. This provides a directly applicable decision-making basis for port scheduling, pilotage scheduling, and logistics coordination.
[0108] Example 2
[0109] This embodiment provides an electronic device, including a memory and a processor. The processor executes a program stored in the memory to implement the high-precision prediction method for ship arrival time based on a long short-time neural network, as described above. The device includes a processor and a memory, which are coupled. The memory stores program instructions, and when these instructions are executed by the processor, the task management method described above is implemented. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. The memory can be an internal memory of the Random Access Memory (RAM) type. The processor and memory can be integrated into one or more independent circuits or hardware, such as Application Specific Integrated Circuits (ASICs). It should be noted that the computer program in the aforementioned memory can be implemented as a software functional unit and, when sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which can be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention.
[0110] Example 3
[0111] This embodiment provides a storage medium, wherein the computer-executable instructions of the storage medium, when executed by a computer processor, are used to perform the high-precision prediction method for ship arrival time based on a long short-time neural network as described above. The storage medium can be an electronic medium, magnetic medium, optical medium, electromagnetic medium, infrared medium, or a semiconductor system or propagation medium. The storage medium may also include semiconductor or solid-state memory, magnetic tape, removable computer disk, random access memory (RAM), read-only memory (ROM), hard disk, and optical disc. Optical discs may include optical disc-read-only memory (CD-ROM), optical disc-read / write (CD-RW), and DVD.
[0112] Verification Example 1
[0113] The following uses AIS data and meteorological data from the Port of New York as a dataset to predict ship arrival times, in order to verify the effectiveness of this invention.
[0114] Figure 2 This shows a comparison between the predicted and actual arrival times of ships.
[0115] The prediction results show that the method proposed in this invention has a prediction bias of less than 5% in most samples. Specifically, in short-term scenarios with a prediction duration of less than 10 hours, the error is controlled within ±0.5 hours; in medium- and long-term scenarios with a prediction duration of more than 50 hours, the error is controlled within 1.5 hours. Compared with the traditional LSTM model, the proposed method has significantly improved prediction accuracy and stability, and can meet the practical application requirements of port scheduling for ETA prediction accuracy.
[0116] In summary, the high-precision prediction method for ship arrival time based on long short-time neural networks proposed in this invention has good performance in predicting ship arrival time.
[0117] The above description of the embodiments is provided to enable those skilled in the art to understand and use the invention. It will be apparent to those skilled in the art that various modifications can be made to these embodiments, and the general principles described herein can be applied to other embodiments without inventive effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made by those skilled in the art based on the disclosure of the present invention without departing from the scope of the invention should be within the protection scope of the present invention.
Claims
1. A high-precision prediction method for ship arrival time based on long short-time neural networks, characterized in that, Includes the following steps: Spatiotemporal alignment of AIS data and nautical log data is performed. Speed and position statistics are generated by aggregating AIS data. Within a preset time window, nautical log records are matched and the fused speed is calculated. Meteorological parameters are obtained by spatiotemporal interpolation and fusion of meteorological data based on the ship's position, and missing values are filled and the coding is standardized for the ship's static information. The fused flight speed, meteorological parameters, and static information obtained after processing are synchronously constructed into time-series samples according to a unified time axis, and the time-series samples are subjected to trajectory segmentation and smoothing. By using recursive feature elimination and cross-validation, the optimal feature subset is iteratively selected from spatial features, meteorological features, temporal features, and ship dynamic and static features; Using the optimal feature subset as input features, a bidirectional long short-term memory network is constructed, and the model is trained based on the processed time-series samples corresponding to the optimal feature subset. Based on the trained bidirectional long short-term memory network, the ship arrival time prediction is realized.
2. The high-precision prediction method for ship arrival time based on long short-time neural networks according to claim 1, characterized in that, The specific process of aligning AIS data and nautical log data in time and space, generating speed and position statistics by aggregating AIS data, and matching nautical log records within a preset time window to calculate the fused speed includes: AIS data is aggregated at the hourly granularity to calculate the median airspeed and average latitude and longitude of AIS within that hour; Using the hourly records in the nautical log as the center, a sliding time window is set to calculate the spatial distance between the log record and the AIS aggregation point. If the distance is less than the set threshold, the match is considered successful. For the hourly records in the matching nautical log, the weighted average of the AIS median speed and the nautical log speed is used as the fused speed, and the corresponding average latitude and longitude is used as the unified position reference at that moment, thus completing the spatiotemporal alignment and speed fusion.
3. The high-precision prediction method for ship arrival time based on long short-time neural networks according to claim 1, characterized in that, The specific process of obtaining meteorological parameters by spatiotemporal interpolation and fusion of meteorological data based on ship positions includes: Using the ship's current latitude and longitude as the center, select the nearest meteorological grid point in the vicinity, and use the inverse distance weighting method to calculate wind speed, wind direction, and wave height; If the ship's time point falls between two full hours, then linear interpolation is performed using meteorological data from adjacent full hours to obtain continuous meteorological parameters.
4. The high-precision prediction method for ship arrival time based on long short-time neural network according to claim 3, characterized in that, The specific process of performing missing value completion and coding standardization on ship static information includes: For the missing MMSI field in AIS, fuzzy matching is used to complete it by IMO number or ship name string, the ship tonnage unit is unified, and the ship type field is uniquely coded. The completed ship static information is mapped to the corresponding time step, achieving standardized alignment of meteorological, dynamic, and static data on the same time axis.
5. The high-precision prediction method for ship arrival time based on long short-time neural network according to claim 1, characterized in that, The fused flight speed, meteorological parameters, and static information obtained after processing are synchronously constructed into time-series samples according to a unified time axis. The specific process of trajectory segmentation and smoothing of the time-series samples includes: At hourly intervals, the fused flight speed, meteorological parameters, and completed static information are uniformly filled into the continuous time axis to generate time-series samples with equal intervals and no gaps. Based on the location points where the speed is below the parking threshold or the destination information changes, the continuous trajectory is divided into independent segments, so that each segment reflects a complete navigation intention; For each independent flight segment, a recursive filtering algorithm is used to estimate and update the smooth values of latitude, longitude, speed, and heading in sequence to eliminate observation noise and instantaneous jitter, and output a continuous and smooth trajectory sequence.
6. The high-precision prediction method for ship arrival time based on long short-time neural network according to claim 1, characterized in that, The specific process of iteratively selecting the optimal feature subset from spatial features, meteorological features, temporal features, and ship dynamic and static features using recursive feature elimination and cross-validation includes: The specific process of iteratively selecting the optimal feature subset from spatial features, meteorological features, temporal features, and ship dynamic and static features using recursive feature elimination and cross-validation includes: All initial spatial features, meteorological features, temporal features, and ship dynamic and static features are combined into a high-dimensional dataset. Based on the weights of the regression model, the features with the smallest weights are eliminated round by round. After each round of elimination, K-fold cross-validation is used to evaluate the prediction error, and the average performance is recorded as the evaluation of the feature combination in that round. The process is repeated until the remaining features no longer improve performance in K-fold cross-validation. Finally, the spatial features, meteorological features, temporal features, and ship dynamic and static features with the highest evaluated contribution are retained to form the optimal feature subset.
7. The high-precision prediction method for ship arrival time based on long short-time neural network according to claim 1, characterized in that, The specific process of constructing a bidirectional long short-term memory network using the optimal feature subset as input features, and training the model based on the processed time-series samples corresponding to the optimal feature subset includes: The time-series samples after trajectory segmentation and smoothing are divided into training set, validation set, and test set; For each time series sample, only the channel data corresponding to the optimal feature subset is retained to form a simplified multidimensional input sequence; A network structure containing a bidirectional long short-term memory layer is constructed, including: first capturing historical dependencies with a forward-order input sequence, then capturing future constraints with a reverse-order input sequence, and concatenating the two hidden states into a composite feature vector. After the bidirectional long short-term memory layer, an attention layer and a random deactivation layer are connected in sequence. The attention layer weights and aggregates the output of historical periods according to the current hidden state, and the random deactivation layer suppresses overfitting. The mean squared error loss function is used, and the network parameters are iteratively updated through the backpropagation algorithm. During the training process, the validation set error is used for early stopping control until the model performance converges on the validation set. Finally, the optimal network weights are saved, and the predicted ship arrival times are output on the test set.
8. The high-precision prediction method for ship arrival time based on long short-time neural network according to claim 7, characterized in that, The specific process of constructing a network structure containing a bidirectional long short-term memory layer includes: First, the input features are read along the forward and backward time directions in the first layer of bidirectional long short-term memory unit to capture the backward constraints of the ship's future voyage on the current state and the forward dependence of the historical voyage on the current state, and output the forward and backward hidden states. The splicing state output from the first layer is fed into the second layer bidirectional long short-term memory unit for bidirectional encoding again to extract deeper spatiotemporal motion patterns. A random deactivation layer is inserted between two layers of bidirectional long short-term memory units to temporarily block neuronal connections according to a set probability, thereby improving the model's generalization ability. The bidirectional state sequence output from the second layer is input into the attention layer, and weights are dynamically allocated based on the similarity between the current decoding step and the historical steps, highlighting the key sailing periods that affect the arrival time. The weighted high-dimensional representation is mapped into a fully connected layer to a single-step arrival time prediction value, thus completing the construction of a network structure for high-precision ETA estimation.
9. An electronic device, comprising a memory and a processor, characterized in that, The processor is used to execute the program in the memory to implement the high-precision prediction method for ship arrival time based on long short-time neural networks as described in any one of claims 1 to 8.
10. A storage medium containing computer-executable instructions, characterized in that, When executed by a computer processor, the storage medium of the computer-executable instructions is used to perform the high-precision prediction method for ship arrival time based on a long short-time neural network as described in any one of claims 1 to 8.
Citation Information
Cited By
Marine bulk carrier navigational speed forecasting method and system
CN121658909A