A ship navigation condition determination method based on a large language model
By constructing a domain-adaptive embedding vector model and a six-degree-of-freedom motion surrogate model, and combining the illusion suppression function and particle swarm optimization algorithm, the illusion problem of large language models in ship navigation condition assessment is solved, achieving reliable navigation condition assessment and motion prediction, and improving navigation safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 青岛国实科技集团有限公司
- Filing Date
- 2026-03-02
- Publication Date
- 2026-06-05
AI Technical Summary
Large language models are prone to generating factual errors when generating ship navigation condition assessments, leading to unreliable assessment results.
By constructing a domain-adaptive embedding vector model and a six-degree-of-freedom motion agent model, combined with the illusion suppression function and particle swarm optimization algorithm, and utilizing Bayesian neural networks to quantify uncertainty, a method for determining ship navigation conditions based on a large language model is constructed. This method obtains environmental and ship state parameters, performs navigation condition assessment, conducts multi-dimensional credibility scoring, and triggers a manual review mechanism.
It effectively suppresses the illusionary output of large language models, improves the reliability and accuracy of navigation condition assessment, provides quantitative support for motion prediction uncertainty, and ensures navigation safety.
Smart Images

Figure CN122152891A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of artificial intelligence and ship navigation decision-making, specifically, it relates to a method for determining ship navigation conditions based on a large language model. Background Technology
[0002] In current ship navigation safety management, traditional methods for determining navigation conditions mainly rely on human experience combined with meteorological forecast data for route planning and risk assessment. In recent years, with the development of artificial intelligence technology, some systems have begun to introduce machine learning models to predict marine environmental parameters and assist in decision-making. However, these traditional methods have limitations when dealing with complex sea conditions and the fusion of multi-source heterogeneous data. With the maturity of large language model technology, its application to intelligent assessment of ship navigation conditions has become a research hotspot. However, large language models have an inherent illusion problem when generating navigation safety assessment texts; that is, the model may generate false judgments that do not conform to actual marine environmental data or lack knowledge base support. Such factual errors can lead to serious consequences in the field of maritime safety. In other words, existing technologies suffer from the technical problem that large language models are prone to generating factual error illusions when generating ship navigation condition assessments, leading to unreliable assessment results. Summary of the Invention
[0003] In view of this, the present invention provides a method for determining ship navigation conditions based on a large language model, which can solve the technical problem in the prior art that large language models are prone to generating factual error illusions when generating ship navigation condition assessments, resulting in unreliable assessment results.
[0004] This invention is implemented as follows: It provides a method for determining ship navigation conditions based on a large language model. This method obtains the ship's position coordinates to generate a query region, calls a marine environment forecasting interface to obtain raw environmental data and calculate environmental parameters, and simultaneously acquires the ship's real-time status parameters. The structured query statement is converted into a semantic vector using a domain-adaptive embedding vector model. Knowledge entries and confidence scores are retrieved from a ship domain knowledge vector library. The ship's real-time status parameters and environmental parameters are input into a six-degree-of-freedom motion proxy model to predict the ship's motion amplitude and motion uncertainty interval. The knowledge entries, confidence scores, motion amplitude, motion uncertainty interval, and environmental parameters are input into the large language model to generate a preliminary navigation condition assessment text. Key statements are extracted and input into a hallucination suppression function to calculate a credibility score. Based on the credibility score, manual review is triggered or key statements are retained to form a final navigation condition assessment report. Based on the final navigation condition assessment report, a particle swarm optimization algorithm is used to search for and optimize the speed sequence.
[0005] The domain-adaptive embedding vector model is trained on a dataset of ship terminology pairs using a fine-tuning strategy based on contrastive learning. It enhances the semantic boundary recognition capability of ship domain terms by maximizing the semantic similarity of positive sample pairs and minimizing the semantic similarity of negative sample pairs.
[0006] The structure of the six-degree-of-freedom motion proxy model is as follows: the input layer receives real-time ship state parameters and environmental parameters, and after passing through a fully connected hidden layer, it outputs motion amplitude prediction values and uncertainty estimates. The fully connected hidden layer uses a calibrated linear unit function as the activation function.
[0007] The training dataset establishment steps for the six-degree-of-freedom motion proxy model involve using computational fluid dynamics simulation software to generate six-degree-of-freedom motion time series data with different combinations of sea conditions and ship states, and performing Fourier transform on the time series data to extract the main frequency amplitude as the label value.
[0008] The training of the six-degree-of-freedom motion surrogate model adopts a Bayesian neural network framework. During the training process, prior distribution constraints are applied to the network weights and posterior distribution parameters are learned through variational inference. An active learning strategy is used to select the sample with the highest prediction uncertainty for simulation labeling.
[0009] Among them, the collaborative framework of uncertainty quantification and active learning based on Bayesian neural networks applies probability distribution assumptions to the weights of the neural network and uses Monte Carlo sampling to generate multiple prediction results from the posterior distribution of the weights. The variance of the prediction results reflects the model's cognitive uncertainty about the current input.
[0010] The hallucination suppression function calculates a credibility score based on three dimensions: knowledge item coverage, motion uncertainty interval width, and semantic consistency. When the credibility score falls within the high-risk range, manual review is triggered, and when the credibility score falls within the medium-risk range, a conservative correction is made.
[0011] The knowledge item coverage rate is calculated as the proportion of the number of knowledge items whose semantics overlap with the preliminary navigation condition assessment text to the total number of recalled items. The motion uncertainty interval width is calculated by normalizing and summing the difference between the upper and lower bounds of the motion uncertainty interval.
[0012] The execution of the particle swarm optimization algorithm includes initializing the population size to a number of particles, with each particle's position vector representing the speed value within a time window, employing a linearly decreasing inertial weight strategy to balance global exploration and local exploitation capabilities, and introducing differential evolution mutation operations in the later stages of iteration to improve convergence accuracy.
[0013] The fitness function value is calculated by multiplying the normalized total fuel consumption by the fuel weight coefficient and the normalized total flight time by the time weight coefficient, wherein the sum of the fuel weight coefficient and the time weight coefficient is 1.
[0014] The construction of the ship domain knowledge vector base includes collecting ship design parameter documents, international maritime collision avoidance rules text, severe sea condition response guidelines and historical nautical logs, and then using natural language processing technology for word segmentation and entity recognition, and dividing it into text blocks according to the principle of semantic integrity.
[0015] The environmental parameters include horizontal average wind speed, horizontal average wind direction, significant wave height, vertical stratified average sea surface temperature, and ocean current vector velocity. The calculation method is to multiply the grid point data in the query area by time weight and spatial weight, sum them, and then normalize them.
[0016] The final navigation conditions assessment report includes a chart showing the time-series changes in environmental parameters of the target sea area, a textual description of the navigation safety level assessment results and risk causes, a list of recommended countermeasures, and a comparative analysis table of optimized route plans and speed adjustment recommendations.
[0017] Among them, the hard negative sample mining mechanism calculates the semantic similarity of all term pairs in the ship term pair dataset, and selects term pairs with semantic similarity within a set range as hard negative samples, which is used to enhance the domain adaptive embedding vector model's ability to distinguish subtle semantic differences.
[0018] The time window length is the unit segment length obtained by dividing the total flight length by the number of time windows. The number of time windows is set as an integer value within a set range based on the total flight length and the expected decision granularity.
[0019] The present invention also provides a ship navigation condition determination system based on a large language model, characterized in that the system is implemented by a computer, the computer is provided with a readable storage medium, the readable storage medium stores program instructions, and the program instructions execute the method described above when running in the computer.
[0020] This invention addresses the problem of factual error illusions in large language model navigation condition assessments by constructing a structured input system that includes knowledge item confidence scores, six-degree-of-freedom motion prediction uncertainty intervals, and marine environmental parameters. It also introduces an illusion suppression function to perform multi-dimensional credibility scoring on key statements output by the large language model. Specifically, this invention utilizes a domain knowledge vector library retrieval mechanism to provide traceable knowledge sources for the large language model's reasoning. It uses a Bayesian neural network to quantify motion prediction uncertainty, providing numerical constraints on the model's output confidence. The illusion suppression function calculates credibility scores based on three dimensions: knowledge item coverage, motion uncertainty interval width, and semantic consistency. When the score falls below a threshold, a manual review mechanism is triggered to prevent erroneous information from being transmitted to the final report. In summary, this invention solves the technical problem mentioned in the background art where large language models are prone to factual error illusions when generating ship navigation condition assessments, leading to unreliable assessment results. Attached Figure Description
[0021] Figure 1 This is a diagram illustrating the overall architecture of the decision support system.
[0022] Figure 2 Build a flowchart for the domain knowledge base.
[0023] Figure 3 A flowchart for large model inference and report generation.
[0024] Figure 4 A flowchart for user operations. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below.
[0027] This invention provides a method for determining ship navigation conditions based on a large language model, comprising the following steps:
[0028] S1. Obtain the latitude and longitude coordinates of the ship's current position and generate a query area with a diameter of 150km centered on the latitude and longitude coordinates. Call the marine environment forecast interface to obtain the raw data of wind speed, wind direction, waves, ocean currents and sea surface temperature for the next 12 hours, 24 hours and 36 hours in the query area. After spatial interpolation and outlier removal of the raw data of wind speed, wind direction, waves, ocean currents and sea surface temperature, calculate the horizontal average wind speed, horizontal average wind direction, significant wave height, vertical stratified average sea surface temperature and ocean current vector velocity. Simultaneously obtain the ship's real-time draft, real-time speed, real-time heading, real-time main engine power and real-time load status parameters.
[0029] S2. Construct a structured query statement by combining the ship's real-time draft, real-time speed, real-time course, real-time main engine power, and real-time load status parameters with the horizontal average wind speed, horizontal average wind direction, significant wave height, vertical stratified average sea surface temperature, and ocean current vector velocity. Convert the structured query statement into a high-dimensional semantic vector using a domain-adaptive embedding vector model. Perform similarity retrieval in a pre-established ship domain knowledge vector library and recall the top 10 knowledge entries and their corresponding knowledge entry confidence scores.
[0030] S3. Input the ship's real-time draft, real-time speed, real-time course, real-time main engine power, and real-time load status parameters, along with the horizontal average wind speed, significant wave height, and ocean current vector velocity, into a six-degree-of-freedom motion proxy model to predict the ship's roll angle amplitude, pitch angle amplitude, bow angle amplitude, sway displacement amplitude, pitch displacement amplitude, and heave displacement amplitude over the next 12, 24, and 36 hours. Calculate the motion uncertainty intervals for the roll angle amplitude, pitch angle amplitude, bow angle amplitude, sway displacement amplitude, pitch displacement amplitude, and heave displacement amplitude.
[0031] S4. Input the first 10 knowledge items, knowledge item confidence scores, roll angle amplitude, pitch angle amplitude, bow angle amplitude, sway displacement amplitude, sway displacement amplitude, heave displacement amplitude, motion uncertainty interval, and the horizontal average wind speed, horizontal average wind direction, significant wave height, vertical stratified average sea surface temperature, and ocean current vector velocity into the large language model for reasoning, and generate a preliminary navigation condition assessment text that includes navigation risk level assessment, countermeasure suggestions, and speed adjustment suggestions;
[0032] S5. Extract key statements related to navigation safety judgment from the preliminary navigation condition assessment text and input them into the hallucination suppression function to calculate the credibility score. When the credibility score is in the high-risk range, mark the corresponding key statements and trigger the manual review process. When the credibility score is in the safe range, retain the key statements to form the final navigation condition assessment report.
[0033] S6. Based on the speed adjustment suggestions in the final navigation condition assessment report, extract the total voyage length and arrival time constraints, divide the total voyage length into a number of time windows and set an initial speed value for each time window, use the particle swarm optimization algorithm to iteratively search for the optimal speed sequence that minimizes fuel consumption and satisfies the arrival time constraints, and output the optimal speed sequence as a speed scheduling scheme.
[0034] The domain-adaptive embedding vector model is trained on a ship terminology pair dataset using a fine-tuning strategy based on contrastive learning. It enhances the semantic boundary recognition capability of ship domain terms by maximizing the semantic similarity of positive sample pairs and minimizing the semantic similarity of negative sample pairs. The negative sample pairs are generated by filtering from similar but semantically different terms through a hard negative sample mining mechanism.
[0035] The specific structure of the six-degree-of-freedom motion proxy model is as follows: the input layer receives nine environmental and ship state parameters, including the ship's real-time draft, real-time speed, real-time heading, real-time main engine power, real-time load parameters, horizontal average wind speed, significant wave height, eastward component of ocean current vector velocity, and northward component of ocean current vector velocity. After passing through four fully connected hidden layers, it outputs six predicted motion amplitude values and six uncertainty estimates. The number of neurons in the fully connected hidden layers are 256, 128, 64, and 32 respectively, and the activation function is a calibrated linear unit function. The steps for establishing the training dataset of the six-degree-of-freedom motion proxy model specifically include generating 1000 sets of high-precision six-degree-of-freedom motion time series data with different sea state and ship state combinations using computational fluid dynamics simulation software, and processing the six-degree-of-freedom motion time series data... The main frequency amplitude of each degree of freedom is extracted using Fourier transform as the label value, and the corresponding environmental and ship state parameters are used as input features to construct sample pairs. The training steps of the six-degree-of-freedom motion surrogate model specifically include training the six-degree-of-freedom motion surrogate model using a Bayesian neural network framework. During the training process, prior distribution constraints are applied to the network weights and posterior distribution parameters are learned through variational inference. An active learning strategy is used to calculate the prediction uncertainty of the six-degree-of-freedom motion surrogate model for unlabeled samples after each round of training. The 50 samples with the highest prediction uncertainty are selected for computational fluid dynamics simulation labeling and added to the training set for the next round of iterative training. The iterative training process is repeated until the root mean square error of the prediction of the six-degree-of-freedom motion surrogate model on the validation set is less than 8% and the uncertainty estimation calibration error is less than 5%.
[0036] The proposed collaborative framework for uncertainty quantification and active learning based on Bayesian neural networks replaces traditional point estimation by applying probability distribution assumptions to the neural network weights. It utilizes Monte Carlo sampling to generate multiple prediction results from the learned posterior distribution of the weights. The variance of these prediction results directly reflects the model's cognitive uncertainty regarding the current input. This framework uses this cognitive uncertainty as a metric for sample information content, automatically selecting the most uncertain samples from the six-degree-of-freedom motion surrogate model for priority high-cost computational fluid dynamics simulation annotation. Compared to random sampling annotation strategies, this achieves higher model performance improvements with the same annotation budget. The collaborative framework of uncertainty quantification and active learning tightly couples uncertainty estimation with data labeling decisions through iterative loops, significantly enhancing the predictive ability of the six-degree-of-freedom motion surrogate model for high-risk boundary areas in sea state space. Simultaneously, the motion uncertainty range output by the six-degree-of-freedom motion surrogate model provides a quantitative and reliable basis for subsequent navigation risk assessment, preventing the model from making overconfident and erroneous predictions under inputs outside the training data distribution. This collaborative framework of uncertainty quantification based on Bayesian neural networks and active learning reduces dependence on large-scale labeled data while ensuring the predictive reliability of the six-degree-of-freedom motion surrogate model at critical safety boundaries, providing more robust motion response prediction support for ship decision-making under extreme sea states.
[0037] The illusion suppression function is used to adjust the confidence threshold of the large language model output. The confidence score is calculated based on three dimensions: knowledge item coverage, motion uncertainty interval width, and semantic consistency. When the area is determined to be high-risk, manual review is triggered. This is based on the credibility score. When the risk level is determined to be in the medium-risk range, the key statements are conservatively revised to reduce the intensity of the risk level description. When the credibility score is... When a key statement is determined to be within a safe range, it is directly retained. The illusion suppression function, combined with an improved Gaussian kernel function, performs weighted smoothing on the confidence score of the knowledge item. The improved Gaussian kernel function dynamically adjusts the weight decay rate based on the semantic distance between knowledge items by introducing an adaptive bandwidth parameter, so that the contribution of semantically similar knowledge items to the confidence score is more balanced. When the large language model outputs factual error illusions or logical reasoning illusions, the illusion suppression function gives a clear risk warning mark and prevents the erroneous information from being transmitted to the final navigation condition assessment report.
[0038] The knowledge entry coverage rate is calculated by counting the proportion of the number of entries in the first 10 knowledge entries that semantically overlap with the preliminary navigation condition assessment text to the total number of recalled entries. The motion uncertainty interval width is calculated by normalizing and summing the differences between the upper and lower bounds of the motion uncertainty intervals of the roll angle amplitude, pitch angle amplitude, yaw angle amplitude, sway displacement amplitude, pitch displacement amplitude, and heave displacement amplitude. The semantic consistency is calculated by using cosine similarity to measure the average similarity between the semantic vector of the preliminary navigation condition assessment text and the semantic vector of the first 10 knowledge entries.
[0039] The specific execution steps of the particle swarm optimization algorithm include initializing the population size to 50 particles, where the position vector of each particle represents the number of speed values within the time window, the velocity vector represents the speed search direction, and the speed constraint range is set from the minimum safe speed to the maximum design speed. During the iteration process, the total fuel consumption and total travel time of each particle corresponding to the optimized speed sequence are calculated as a weighted combination as the fitness function value. An inertial weight linear decreasing strategy is adopted to decrease the weight from 0.9 to 0.4 to balance global exploration and local exploitation capabilities. In the later stage of the iteration, differential evolution mutation operation is introduced to perturb the current best particle to improve the convergence accuracy. The termination condition of the iteration process is that the improvement of the fitness function value is less than 0.1% for 20 consecutive generations or the maximum number of iterations of 200 generations is reached.
[0040] The total fuel consumption calculation formula is expressed as follows: substitute the speed value of each time window into the ship's main engine fuel consumption rate curve to obtain the fuel consumption per unit time, multiply the fuel consumption per unit time by the corresponding time window length, sum the results for all time windows, and then divide by the theoretical maximum fuel consumption corresponding to the maximum design speed for normalization.
[0041] The formula for calculating the total sailing time is as follows: divide the total voyage length by the speed value of each time window to obtain the sailing time of each time window, sum the sailing times of all time windows, and then divide by the theoretical maximum sailing time corresponding to the minimum safe speed for normalization.
[0042] The fitness function value calculation formula is expressed as follows: multiply the normalized total fuel consumption by the fuel weight coefficient and add the normalized total flight time by the time weight coefficient. The sum of the fuel weight coefficient and the time weight coefficient is 1. By adjusting the ratio of the fuel weight coefficient and the time weight coefficient, a preference trade-off between fuel economy and flight timeliness is achieved.
[0043] The steps for constructing the ship domain knowledge vector base include collecting ship design parameter documents, texts of international maritime collision avoidance rules, guidelines for dealing with severe sea conditions, and historical nautical logs. Natural language processing technology is used to segment and identify entities in these documents, dividing them into text blocks of an average length of 512 characters according to the principle of semantic integrity. The domain-adaptive embedding vector model is then used to vectorize these text blocks, generating 768-dimensional semantic vectors. Finally, the 768-dimensional semantic vectors and the corresponding original text blocks are stored in a vector database, and an index structure based on approximate nearest neighbor search is established.
[0044] The formula for calculating the horizontal average wind speed is as follows: multiply the instantaneous wind speed values of all grid points within the query area by their corresponding time and spatial weights, sum the results, divide by the sum of the products of the time and spatial weights of all grid points, and finally divide by the historical maximum wind speed of the area for normalization.
[0045] The formula for calculating the horizontal average wind direction is as follows: decompose the instantaneous wind speed values of all grid points in the query area into east-west and north-south components, calculate the average value of the east-west and north-south components respectively, and use the arctangent function to calculate the wind direction angle value corresponding to the average value of the east-west component and the average value of the north-south component.
[0046] The formula for calculating the effective wave height is as follows: sort the wave height values of all grid points in the query area in descending order, select the first third of the wave height values, calculate the arithmetic mean as the effective wave height, and then divide it by the historical maximum wave height of the area for normalization.
[0047] The formula for calculating the vertically stratified average sea temperature is as follows: the query area is divided into three layers according to the seawater depth: surface, middle and deep. The sea temperature values of all sampling points in each layer are multiplied by the length of the corresponding depth interval, summed, divided by the total depth interval length of the layer, and finally divided by the standard sea temperature value for normalization.
[0048] The ocean current vector velocity is calculated by decomposing the ocean current velocity of all grid points in the query area into eastward and northward components, and then calculating the spatial weighted average of the eastward and northward components respectively. The spatial weight is the proportion of the sub-grid area corresponding to each grid point to the total query area.
[0049] The final navigation condition assessment report includes a chart showing the time-series changes in environmental parameters of the target sea area, a textual description of the navigation safety level assessment results and risk causes, a list of recommended countermeasures for the current sea conditions, and a comparative analysis table of optimized route plans and speed adjustment recommendations. The presentation format supports text export and interface highlighting functions.
[0050] The ship's main engine fuel consumption rate curve is a nonlinear function curve representing the relationship between speed and fuel consumption per unit time, obtained in advance through engine bench tests or ship actual sea tests. The ship's main engine fuel consumption rate curve is fitted with measured data points using a cubic polynomial and stored in the system database for use by the particle swarm optimization algorithm.
[0051] The hard negative sample mining mechanism calculates the semantic similarity of all term pairs in the ship term pair dataset and selects term pairs with semantic similarity in the range of 0.4 to 0.7 as hard negative samples. These hard negative samples have certain semantic relevance but express different professional concepts, which is used to enhance the domain adaptive embedding vector model's ability to distinguish subtle semantic differences.
[0052] The time window length is the unit segment length obtained by dividing the total flight length by the number of time windows. The number of time windows is set to an integer value between 8 and 20 based on the total flight length and the expected decision granularity.
[0053] Optionally, the present invention also provides a computer-based method for determining ship navigation conditions based on a large language model, wherein the computer is equipped with a readable storage medium storing program instructions, and the program instructions, when run on the computer, can execute the aforementioned method for determining ship navigation conditions based on a large language model.
[0054] The specific implementation methods of the above steps are described in detail below.
[0055] The specific implementation of step S1 involves first obtaining the latitude and longitude coordinates of the current ship's position through the ship navigation system. A circular query area with a radius of 75 km is then constructed using these coordinates as the center. The purpose of this circular query area is to cover the ship's possible navigation range for the next 12 to 36 hours while balancing data accuracy and computational efficiency. Subsequently, the application programming interface (API) of an external marine environmental forecasting service is invoked. This API outputs gridded marine hydrological and meteorological data based on a numerical weather prediction model, acquiring raw data on wind speed, wind direction, waves, ocean currents, and sea surface temperature for the next three time scales within the circular query area. A bilinear interpolation algorithm is then applied to the raw data to map the irregular grid data to a standard grid. This bilinear interpolation algorithm achieves spatial smoothing by calculating the distance-weighted average of four known grid points surrounding the target point, eliminating spatial discontinuities caused by inconsistent data sampling point locations. Anomaly detection is performed synchronously. Abnormal data points exceeding a reasonable range of variation are identified by comparing the data gradients of adjacent grid points. The threshold reference value for the reasonable range of variation is that the difference between adjacent grid points should not exceed three times the historical statistical standard deviation of that parameter. After removing the abnormal data points, the average value of surrounding valid data points is used to fill the gap. Based on the processed grid data, the horizontal average wind speed, horizontal average wind direction, significant wave height, vertical stratified average sea surface temperature, and ocean current vector velocity are calculated. The calculation process uses a weighted average method to summarize data from multiple spatially distributed sampling points. The weighting coefficients are determined according to the spatial location and time interval of the sampling points, ultimately obtaining statistical feature values that can represent the overall environmental state of the circular query area. The ship's real-time draft, real-time speed, real-time heading, real-time main engine power, and real-time load status parameters are read in parallel from the Automatic Identification System (AIS) and Ship Management System. These parameters are updated every 10 seconds to ensure data timeliness.
[0056] The specific implementation of step S2 involves organizing the real-time ship draft, real-time ship speed, real-time ship heading, real-time main engine power, and real-time ship load status parameters obtained in step S1, along with the horizontal average wind speed, horizontal average wind direction, significant wave height, vertical stratified average sea surface temperature, and ocean current vector velocity, into a structured query statement according to a predefined text template. The text template design follows the named entity recognition principle in natural language processing to ensure that the semantic roles of each parameter in the statement are clearly identifiable. A domain-adaptive embedding vector model is then invoked to vectorize the structured query statement. This model is fine-tuned on a dataset of ship terminology based on a contrastive learning framework. The contrastive learning framework constructs positive and negative sample pairs and optimizes the cosine similarity difference between samples, making semantically similar ship terminology closer in the high-dimensional vector space while semantically different terms are further apart, thereby strengthening the model's ability to distinguish subtle semantic differences in the ship domain. The vectorization outputs a 768-dimensional high-dimensional semantic vector, which encodes the deep semantic features of the ship's state and environmental information contained in the structured query statement. Vector retrieval based on cosine similarity is performed in a pre-established knowledge vector database for the shipbuilding domain. Cosine similarity is calculated by taking the cosine of the angle between the high-dimensional semantic vector and the vector of each knowledge entry in the database; a value closer to 1 indicates a stronger semantic relevance. An approximate nearest neighbor search algorithm is employed to accelerate the retrieval process. This algorithm divides the high-dimensional vector space into multiple subspaces by constructing a multi-layered hash index, performing precise similarity calculations only within candidate subspaces, significantly reducing retrieval time complexity. The top 10 knowledge entries by cosine similarity and their corresponding confidence scores are retrieved. The confidence scores are directly mapped from the cosine similarity values, ranging from 0 to 1. The number of these top 10 entries is chosen to balance breadth of knowledge coverage with inference efficiency.
[0057] The specific implementation of step S3 involves inputting the real-time draft, real-time speed, real-time heading, real-time main engine power, and real-time load status parameters of the ship obtained in step S1, along with the horizontal average wind speed, significant wave height, and ocean current vector velocity, as nine input features into a six-degree-of-freedom motion proxy model. This six-degree-of-freedom motion proxy model is constructed based on a Bayesian neural network framework. This framework applies a probability distribution assumption to the weight parameters of the neural network rather than traditional deterministic point estimation, and learns the posterior distribution parameters of the weights through variational inference. During the forward inference process of the six-degree-of-freedom motion proxy model, Monte Carlo sampling is used to randomly sample 100 sets of weight parameters from the learned posterior distribution of the weights for multiple forward propagation calculations. Each forward propagation outputs a set of predicted values for the roll angle amplitude, pitch angle amplitude, bow angle amplitude, sway displacement amplitude, thrust displacement amplitude, and heave displacement amplitude. The statistical mean of the 100 predicted values is calculated as the final prediction result. The standard deviation of the 100 predicted values represents the motion uncertainty interval of the prediction, which reflects the model's degree of uncertainty regarding the current input environment. The six-degree-of-freedom motion surrogate model iteratively optimizes the training dataset through an active learning strategy. During training, it automatically identifies the input samples with the highest prediction uncertainty and prioritizes high-precision computational fluid dynamics simulation annotation for these samples. This active learning strategy enables the model to achieve higher prediction accuracy in key sea state boundary areas with fewer labeled samples. The six-degree-of-freedom motion surrogate model outputs motion amplitude predictions and motion uncertainty intervals for the next 12, 24, and 36 hours, providing quantitative data support for subsequent navigation risk assessment of ships' motion response.
[0058] The specific implementation of step S4 involves inputting the first 10 knowledge entries recalled in step S2, their confidence scores, and the roll, pitch, bow, sway, heave, and motion uncertainty intervals output in step S3, along with the horizontal average wind speed, horizontal average wind direction, significant wave height, vertical stratified average sea surface temperature, and ocean current vector velocity obtained in step S1, into the large language model using a retrieval enhancement generation mechanism. This retrieval enhancement generation mechanism injects the original text content of the first 10 knowledge entries as external knowledge into the context window of the large language model, guiding the model to reason based on this external knowledge rather than solely relying on the internal knowledge encoded in the model parameters, thereby significantly reducing the probability of the model producing illusory outputs. The large language model is based on an autoregressive language modeling paradigm, encoding the input text sequence through a multi-layer transformer structure. This transformer structure employs a self-attention mechanism to capture long-distance dependencies between words at different positions in the input sequence, enabling the model to understand the complex coupling relationships between ship state and environmental parameters. The large language model performs a multi-step reasoning process. First, it analyzes the impact of the horizontal average wind speed and significant wave height on ship stability. Then, it assesses the risk of roll instability by combining the roll angle amplitude and motion uncertainty interval. Next, it evaluates the impact of ocean current vector velocity on track deviation. Finally, it integrates the handling regulations and safety standards from the first 10 knowledge items for compliance judgment. This reasoning process dynamically links the input environmental data, motion prediction results, and knowledge item content through the generation of an attention weight matrix, ensuring that the generated preliminary navigation condition assessment text is logically coherent and based on reliable knowledge support. The preliminary navigation condition assessment text includes three core content modules: navigation risk level assessment, countermeasure recommendations, and speed adjustment recommendations. The navigation risk level assessment is based on a comprehensive determination of whether the roll angle amplitude exceeds 10 degrees, the significant wave height exceeds 4 meters, and the width of the motion uncertainty interval exceeds a threshold reference value of 20%.
[0059] The specific implementation of step S5 involves extracting key statements related to navigation safety judgments from the preliminary navigation condition assessment text generated in step S4. The extraction of these key statements utilizes named entity recognition technology to locate sentence fragments containing keywords such as navigation risk level, safety threshold judgment, and maneuvering recommendations. These key statements are then input into a hallucination suppression function for credibility calculation. This function constructs a multi-factor evaluation model based on three dimensions: knowledge item coverage, motion uncertainty interval width, and semantic consistency. The knowledge item coverage is calculated by statistically analyzing the percentage of the first 10 knowledge items referenced or semantically corresponding to the key statements; a higher value indicates more comprehensive knowledge support for the generated content. The motion uncertainty interval width is calculated by normalizing and summing the motion uncertainty intervals of roll, pitch, yaw, sway, and heave amplitudes; a higher value indicates higher uncertainty in the underlying motion prediction. Semantic consistency is measured by calculating the mean cosine similarity between the semantic vector of the key statement and the semantic vectors of the first 10 knowledge items; a higher value indicates better semantic alignment between the generated content and the knowledge base. The illusion suppression function calculates a credibility score by weighting the three dimensions with coefficients of 0.4, 0.3, and 0.3. These weights are determined based on experimental statistics, which show that knowledge coverage contributes most to credibility. An improved Gaussian kernel function is used to weight and smooth the confidence scores of the knowledge items. This improved kernel function introduces an adaptive bandwidth parameter to dynamically adjust the weight distribution based on the semantic distance between knowledge items, resulting in a more balanced impact of semantically similar knowledge items on the credibility score. When the credibility score is between 0 and 0.3, it is considered a high-risk range. The key statement is marked, and a manual review process is triggered, where navigation experts manually verify the accuracy of the key statement. When the credibility score is between 0.3 and 0.6, it is considered a medium-risk range. The key statement is conservatively revised, reducing the intensity of the risk level description and adding caution prompts. When the credibility score is between 0.6 and 1, it is considered a safe range. The key statement is directly retained and summarized to form the final navigation condition assessment report.
[0060] The specific implementation of step S6 involves extracting speed adjustment suggestions from the final navigation condition assessment report generated in step S5, and analyzing the two key parameters included in the speed adjustment suggestions: total voyage length and arrival time constraint. Based on the total voyage length and expected decision granularity, the voyage is divided into 8 to 20 time windows. The number of time windows must balance the flexibility of speed adjustment with computational complexity; too few time windows result in an overly coarse speed adjustment strategy, while too many increase the computational burden of optimization. An initial speed value is set for each time window, using a uniform distribution strategy and set as the average speed obtained by dividing the total voyage length by the arrival time constraint. A particle swarm optimization algorithm is used to iteratively search and optimize the speed sequence. The particle swarm optimization algorithm initializes a population of 50 particles, where the position vector of each particle represents the combination scheme of the specified number of speed values within the specified time window, and the velocity vector represents the direction and step size of the speed search. The particle swarm optimization algorithm achieves a global search of the solution space by iteratively updating particle positions and velocities. In each iteration, the fitness function value corresponding to the optimized speed sequence for each particle is calculated. This fitness function value comprehensively evaluates a weighted combination of total fuel consumption and total sailing time. Total fuel consumption is obtained by querying the ship's main engine fuel consumption rate curve to obtain the fuel consumption per unit time corresponding to the speed in each time window. The fuel consumption of all time windows is accumulated and normalized. The total sailing time is obtained by accumulating the sailing time of each time window and normalizing it. A speed constraint mechanism is introduced to ensure that the speed value of all time windows is between the minimum safe speed and the maximum design speed. The reference value for the minimum safe speed is 12 knots to ensure rudder effectiveness, and the reference value for the maximum design speed is 95% of the design speed to avoid main engine overload. A linearly decreasing inertia weight strategy is adopted, with the inertia weight decreasing linearly from 0.9 to 0.4. In the early stages of iteration, a larger inertia weight promotes global exploration, while in the later stages, a smaller inertia weight promotes local fine-tuning. In the later stages of iteration, a differential evolution mutation operation is introduced to randomly perturb the current globally optimal particle. This differential evolution mutation operation constructs a mutation vector by randomly selecting three particles from the population, improving the algorithm's ability to escape local optima. The termination condition of the iteration process is that the fitness function value improves by less than 0.1% for 20 consecutive generations or reaches the maximum number of iterations of 200 generations. After the termination condition is met, the optimized speed sequence corresponding to the globally optimal particle is output as the speed scheduling scheme.
[0061] It should be noted that the key technical idea of this invention is first reflected in the domain-adaptive embedding vector model, which is fine-tuned and trained on a dataset of ship terminology using a contrastive learning framework. This significantly enhances the model's ability to identify subtle semantic differences in the ship domain. Compared to the semantic drift problem that exists in general embedding models when dealing with professional terms such as rudder effectiveness, center of gravity, and slamming, the domain-adaptive embedding vector model can accurately capture the semantic boundaries between terms. This makes the knowledge entries retrieved from the knowledge base highly relevant to the query intent, providing accurate professional knowledge support for subsequent large language model inference, avoiding decision bias caused by retrieval errors, and fundamentally improving the professionalism and accuracy of ship navigation condition assessment. Secondly, the six-degree-of-freedom motion surrogate model is based on a collaborative framework of uncertainty quantification and active learning using Bayesian neural networks. By applying probability distributions to the network weights and employing Monte Carlo sampling to output the uncertainty interval, it overcomes the limitations of traditional deterministic neural networks that only output point estimates without quantifying prediction confidence. This collaborative framework not only provides motion amplitude prediction but also simultaneously outputs uncertainty estimates, enabling downstream navigation risk assessment to distinguish between high-confidence and low-confidence predictions and avoid overconfident erroneous decisions in extreme sea conditions. At the same time, the active learning strategy automatically selects and labels high-uncertainty samples, significantly improving the model's prediction accuracy at key safety boundaries under the same labeling budget. Compared to random sampling labeling methods, it achieves efficient iterative optimization of data. Third, the illusion suppression function constructs a multi-factor evaluation model based on three dimensions: knowledge item coverage, motion uncertainty interval width, and semantic consistency. It also combines an improved Gaussian kernel function to weighted smooth the confidence of knowledge items. Compared with the general large language model, which lacks an output credibility evaluation mechanism and is prone to producing illusion output, the illusion suppression function quantifies the knowledge support sufficiency, underlying prediction uncertainty, and semantic alignment of the generated content. This enables tiered credibility control of key statements for navigation safety judgments. When high-risk outputs are detected, manual review is triggered in a timely manner, effectively preventing erroneous decision suggestions from being transmitted to the final report and ensuring the safety and reliability of ship navigation decisions. The synergistic effect of the three key technical approaches forms a closed-loop decision support process, from precise retrieval of professional knowledge to uncertainty perception and prediction, and then to credibility-level control. The domain-adaptive embedding vector model ensures the accuracy and reliability of the knowledge entries input into the large language model. The six-degree-of-freedom motion proxy model provides motion prediction with uncertainty quantification to provide data support for risk assessment. The illusion suppression function performs a comprehensive evaluation based on the confidence information output by the former two. The three work together to significantly improve the decision-making accuracy, interpretability, and safety of the ship navigation condition determination method under complex sea conditions. Compared with traditional solutions based on rule engines or general large language models, this invention can provide quantitative credibility assessment while ensuring professionalism, providing more reliable intelligent support for captains' decisions.
[0062] It should be noted that this invention also solves the following technical problems: In existing ship six-degree-of-freedom motion prediction methods, obtaining high-precision training data based on computational fluid dynamics simulation requires a large amount of computational resources and time. Traditional random sampling and labeling strategies cannot effectively utilize the limited labeling budget, especially in high-risk boundary areas such as extreme sea states where sample scarcity leads to insufficient model prediction reliability. This invention introduces an active learning strategy based on Bayesian neural networks. After each training round, the uncertainty of the model's prediction for unlabeled samples is calculated, and samples with the highest uncertainty are prioritized for computational fluid dynamics simulation labeling. This accurately invests limited labeling resources in the most uncertain samples, significantly improving the model's prediction reliability at critical safety boundaries. Furthermore, in ship speed optimization decisions, traditional methods struggle to flexibly balance fuel economy and sailing timeliness, failing to adapt to the differentiated needs of different voyages for cost control or on-time arrival. This invention introduces adjustable fuel weight coefficients and time weight coefficients into the fitness function of the particle swarm optimization algorithm, weighting the normalized total fuel consumption and total sailing time. This allows the optimized speed sequence to find the optimal balance between energy saving and on-time arrival based on specific voyage requirements.
[0063] Specifically, the principle of this invention is as follows: The solution to the illusion problem in large language model navigation condition assessment lies in establishing a full-chain constraint mechanism from data input to output verification. By using a domain-adaptive embedding vector model to retrieve relevant knowledge entries from a knowledge vector base, external knowledge anchors are provided for large language model reasoning, rather than relying entirely on the model's internal parameter memory, thus reducing the source risk of illusion. A six-degree-of-freedom motion surrogate model uses a Bayesian neural network framework to output prediction results with an uncertainty interval, providing objective numerical boundaries for credibility assessment. The illusion suppression function calculates credibility scores through three dimensions: knowledge entry coverage, motion uncertainty interval width, and semantic consistency, forming a multi-dimensional cross-validation system. When any dimension indicator is abnormal, the system automatically lowers the credibility score and triggers manual review, thereby ensuring the reliability of the assessment results and preventing large language models from generating false judgments that do not match the actual data.
[0064] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.
[0065] The specific implementation of step S1 involves obtaining the latitude and longitude coordinates of the ship's current position and generating a query area with a diameter of 150km centered on these coordinates. The marine environmental forecasting interface is then used to obtain raw data on wind speed, wind direction, waves, ocean currents, and sea surface temperature for the next 12, 24, and 36 hours within the query area. Spatial interpolation and outlier removal are performed on the raw data for wind speed, wind direction, waves, ocean currents, and sea surface temperature. The horizontal average wind speed, horizontal average wind direction, significant wave height, vertically stratified average sea surface temperature, and ocean current vector velocity are then calculated. Simultaneously, the ship's real-time draft, real-time speed, real-time heading, real-time main engine power, and real-time load status parameters are acquired. The formula for calculating the horizontal average wind speed is as follows:
[0066] ;
[0067] In the formula, The horizontal average wind speed; To query the first in the region Line number Column grid points at time Instantaneous wind speed value, in units of ; This is the time weighting coefficient, which is dimensionless and ranges from 0 to 1. It is calculated by normalizing based on time decay. This is the spatial weighting coefficient, which is dimensionless and ranges from 0 to 1. It is calculated by normalizing based on spatial distance. The number of grid rows; Number of grid columns; This represents the number of time sampling points; The highest regional wind speed in historical statistics, in units of The default value is 30. ; This is the grid row index, with values ranging from 1 to... ; For grid column indexes, the value range is 1 to ; This is the index of the time sampling point, with a value range of 1 to... The formula for calculating the horizontal average wind direction is as follows:
[0068] ;
[0069] ;
[0070] ;
[0071] In the formula, For the first Line number The east-west component of the instantaneous wind speed at each grid point, in units of ; For the first Line number The north-south component of the instantaneous wind speed at each grid point, in units of ; This is the normalized average value of the east-west component; This is the normalized average value of the north-south component; This represents the wind direction angle, in degrees. The formula for calculating significant wave height is as follows:
[0072] ;
[0073] In the formula, For significant wave height; The first third of the sorted items in descending order Wave height value, unit: ; This represents the total number of the first third of the wave height values; The highest wave height in the region according to historical statistics, in units of The default value is 15. ; This is an index for wave height values, ranging from 1 to... The formula for calculating the vertically stratified average sea surface temperature is as follows:
[0074] ;
[0075] In the formula, For the first The vertical stratification of the layer corresponds to the average sea surface temperature. The values 1, 2, and 3 correspond to the surface, middle, and deep layers, respectively. For the first The first layer Sea temperature values at each sampling point, in °C; For the first The length of the depth interval corresponding to each sampling point, in units of ; For the first Total number of sampling points within the layer; This is the standard sea surface temperature value, in °C, with a default value of 20 °C. This is the sampling point index, with a value range of 1 to... The calculation method for ocean current vector velocity is described as follows:
[0076] ;
[0077] ;
[0078] In the formula, This is the normalized average value of the eastward component of the ocean current vector velocity; This is the normalized average value of the northward component of the ocean current vector velocity; For the first Line number The eastward component of ocean current velocity at grid points, in units of ; For the first Line number The northward component of ocean current velocity at grid points, in units of ; For the first Line number The area of the subgrid corresponding to each grid point, in units of ; For reference ocean current velocity, the unit is... The default value is 1. .
[0079] The specific implementation of step S2 involves constructing a structured query statement using the ship's real-time draft, real-time speed, real-time heading, real-time main engine power, and real-time load status parameters, along with the horizontal average wind speed, horizontal average wind direction, significant wave height, vertical stratified average sea surface temperature, and ocean current vector velocity. This structured query statement is then converted into a high-dimensional semantic vector using a domain-adaptive embedding vector model. A similarity retrieval is performed in a pre-established ship domain knowledge vector database, recalling the top 10 knowledge entries and their corresponding confidence scores. The similarity retrieval uses cosine similarity calculation, with the specific formula as follows:
[0080] ;
[0081] In the formula, For query vector and the first Similarity scores between knowledge item vectors; For the query vector Dimensional components; For the first The first knowledge entry vector Dimensional components; The vector dimension has a value of 768. This serves as an index for knowledge entries, with values ranging from 1 to 10. This is the vector dimension index, with values ranging from 1 to... .
[0082] The specific implementation methods of steps S3 and S4 are the same as those described above, and will not be repeated in detail here.
[0083] The specific implementation of step S5 involves extracting key statements related to navigation safety judgments from the preliminary navigation condition assessment text and inputting them into a hallucination suppression function to calculate a credibility score. When the credibility score falls within the high-risk range, the corresponding key statements are marked and a manual review process is triggered. When the credibility score falls within the safe range, the key statements are retained, forming the final navigation condition assessment report. The formula for calculating the credibility score is as follows:
[0084] ;
[0085] In the formula, This is the credibility score. Knowledge item coverage; The width of the uncertainty interval for motion; For semantic consistency; , , The weighting coefficients are satisfied. The empirical values are 0.4, 0.3, and 0.3 respectively. The formula for calculating the knowledge item coverage rate is as follows:
[0086] ;
[0087] In the formula, This represents the number of entries in the first 10 knowledge items that semantically overlap with the preliminary navigation condition assessment text. The formula for calculating the width of the motion uncertainty interval is as follows:
[0088] ;
[0089] In the formula, For the first The upper and lower bounds of the uncertainty interval for each degree of freedom motion, where the units for roll, pitch, and yaw angles are degrees, and the units for sway, pitch, and heave displacements are degrees. ; The degrees of freedom are indexed, corresponding in sequence to roll angle, pitch angle, yaw angle, sway displacement, pitch displacement, and heave displacement; For the first The historical maximum difference in the uncertainty interval of a motion with 1 degree of freedom, in units of They are the same. The formula for calculating semantic consistency is as follows:
[0090] ;
[0091] In the formula, The first step in assessing the semantic vector of the text for preliminary navigation conditions. Dimensional components. The improved Gaussian kernel function is expressed as follows:
[0092] ;
[0093] In the formula, For the first Gaussian kernel weights for each knowledge item; For the first Confidence scores for each knowledge item; The adaptive bandwidth parameter is calculated using the following formula: ; This is the base bandwidth parameter, which defaults to 0.2. For the first The semantic distance between each knowledge item and the query vector is calculated using the following formula: .
[0094] The specific implementation of step S6 involves extracting the total voyage length and arrival time constraints based on the speed adjustment recommendations in the final navigation condition assessment report. The total voyage length is divided into time windows, and an initial speed value is set for each time window. A particle swarm optimization algorithm is used to iteratively search for the optimal speed sequence that minimizes fuel consumption and satisfies the arrival time constraints. The optimized speed sequence is then output as the speed scheduling scheme. The formula for calculating the ship's main engine fuel consumption rate curve is as follows:
[0095] ;
[0096] In the formula, For speed The corresponding fuel consumption per unit time, in units of ; , , , The coefficients are cubic polynomial fitting coefficients, obtained through engine bench testing or shipboard testing, with units of [missing information]. , , , ; This is the speed value, in units of The formula for calculating total fuel consumption is as follows:
[0097] ;
[0098] In the formula, Normalized total fuel consumption; For the first The speed values for each time window, in units of ; For the first The length of a time window, in units of ; This represents the number of time windows, and its value is an integer between 8 and 20. Maximum design speed, unit: ; Total flight time, in units of ; This is the time window index, with a value range of 1 to... The formula for calculating the time window length is as follows:
[0099] ;
[0100] In the formula, For the first The length of the flight segment corresponding to each time window, in units of ; 1000 is the unit conversion factor, which will Convert to 3600 is the unit conversion factor. Convert to The formula for calculating the total sailing time is as follows:
[0101] ;
[0102] In the formula, To normalize the total sailing time; Total voyage length, in units of ; Minimum safe speed, unit: The formula for calculating the fitness function value is as follows:
[0103] ;
[0104] In the formula, The fitness function value; This refers to the fuel weighting coefficient. The time weighting coefficient satisfies The formulas for updating particle velocity and position in the particle swarm optimization algorithm are expressed as follows:
[0105] ;
[0106] ;
[0107] In the formula, For the first The particle in the first During the nth iteration The velocity components within each time window, in units of ; For the first The particle in the first During the nth iteration The velocity components within each time window, in units of ; For the first The particle in the first During the nth iteration The speed values for each time window, in units of ; For the first The inertia weight of the next iteration; and This is the learning factor, which is usually set to 2. and A random number between 0 and 1; For the first The best position in the history of the nth particle Dimensional components, unit: ; The position of the global optimum Dimensional components, unit: ; This is the particle index, with a value range from 1 to 50; This is the index for the time window dimension, with values ranging from 1 to... ; This is the iteration number index, with a value ranging from 1 to... ; The maximum number of iterations is set to 200. The formula for calculating the inertia weight is as follows:
[0108] .
[0109] To better understand and implement this invention, a specific application scenario of the invention is provided below as Example 2: To solve practical navigation decision-making problems using the technical solution of this invention, technicians deployed a ship-aided decision analysis system based on language large model technology on a large cargo ship. The ship planned to undertake a long-distance voyage with a total distance of 920 km and an estimated arrival time constraint of 52 hours. Technicians used the system to comprehensively evaluate the navigation conditions and generate an optimized speed scheduling plan.
[0110] like Figure 1 As shown, the overall system architecture comprises three core components: a domain knowledge base construction module, a marine environmental forecast information generation module, and a large-scale model inference and report generation module. Technical personnel first completed the construction of the domain knowledge base. For example... Figure 2As shown, during the data acquisition phase, over a thousand documents were collected, including design parameter documents for the ship type, texts of international maritime collision avoidance rules, maritime laws and regulations, guidelines for handling severe sea conditions, and ship operation and maintenance logs. In the data processing phase, the original documents underwent data cleaning to remove duplicate content, followed by data conversion to standardize various formats. After data integration and classification, relevant thematic content was consolidated, and finally, data annotation was completed, marking the boundaries of professional terms. In the knowledge base construction phase, the processed documents were segmented into text blocks of an average length of 512 characters according to the principle of semantic integrity, generating a total of 52,000 text blocks. A domain-adaptive embedding vector model was then used to generate 768-dimensional semantic vectors, which were then stored in a vector database and indexed. This domain-adaptive embedding vector model was trained on a ship professional terminology pair dataset using a contrastive learning-based fine-tuning strategy. The dataset contained 22,000 term pairs, of which 6,600 term pairs with semantic similarity between 0.4 and 0.7 were selected as hard negative samples through a hard negative sample mining mechanism to enhance the model's ability to distinguish subtle semantic differences.
[0111] After system deployment, technicians obtained the ship's current position coordinates during the navigation preparation phase and generated a query area with a diameter of 150km centered on these coordinates. The system called the marine environmental forecasting interface to obtain raw data on wind speed, wind direction, waves, ocean currents, and sea surface temperature for the next 12, 24, and 36 hours within the query area. Technicians performed spatial interpolation and outlier removal on the acquired raw data before calculating various environmental parameters. The horizontal average wind speed for the next 12 hours was 8.3 m / s, calculated by multiplying the instantaneous wind speed values of all grid points within the query area by time and spatial weights, summing the results, and then normalizing by dividing by the historical maximum regional wind speed of 23 m / s to obtain a normalized value of 0.36. The horizontal average wind direction was calculated by decomposing the wind speed of all grid points into east-west and north-south components, averaging each component, and then using the arctangent function to obtain a wind direction angle of approximately 325 degrees northwest. The significant wave height was calculated by sorting the wave height values of all grid points within the query area in descending order, selecting the top third of the wave height values, and taking the arithmetic mean, which yielded 2.8m. This was then normalized by dividing by the historical maximum wave height of 8.5m for the area, resulting in 0.33. The vertically stratified average sea surface temperature was divided into three layers based on sea depth: surface, mid-water, and deep. The average sea surface temperature was 19.2℃, the mid-water temperature was 17.5℃, and the deep temperature was 15.1℃. These were normalized by dividing each layer by the standard sea surface temperature value of 20℃. The ocean current vector velocity was decomposed into eastward and northward components for all grid points within the query area. A spatially weighted average was calculated, yielding an eastward component of 0.7m / s and a northward component of 0.4m / s. Real-time ship parameters were simultaneously acquired: draft 9.2m, real-time speed 15.5 knots, real-time heading 25 degrees north of east, and real-time main engine power 9200 kW. The load capacity is 38,000 tons when fully loaded.
[0112] Technicians constructed structured query statements using real-time ship parameters and environmental parameters, converted them into high-dimensional semantic vectors using a domain-adaptive embedding vector model, and performed similarity retrieval in a pre-established ship domain knowledge vector library. The system retrieved the top 10 knowledge entries and their corresponding confidence scores, as shown in Table 1.
[0113] Table 1. Recall Knowledge Items and Confidence Scores
[0114]
[0115] Technicians then input the ship's real-time parameters and environmental parameters into a six-degree-of-freedom motion surrogate model for motion prediction. The input layer of this surrogate model receives nine parameters, including the ship's real-time draft (9.2m), real-time speed (15.5 knots), real-time heading (25 degrees east of north), and real-time main engine power (9200 kW). The model uses real-time ship load parameters of 38,000 tons, average horizontal wind speed of 8.3 m / s, significant wave height of 2.8 m, and ocean current vector velocity (eastward component 0.7 m / s, northward component 0.4 m / s). After processing through four fully connected hidden layers, it outputs six predicted motion amplitude values and six uncertainty estimates. The number of neurons in the fully connected hidden layers are 256, 128, 64, and 32 respectively, and the activation function is a calibrated linear unit function. The model predicts that within the next 12 hours, the ship's roll amplitude will be 8.5 degrees, pitch amplitude will be 4.2 degrees, bow amplitude will be 2.6 degrees, sway amplitude will be 1.8 m, pitch amplitude will be 2.7 m, and heave amplitude will be 1.1 m. Uncertainty quantification based on a Bayesian neural network framework outputs the uncertainty ranges for each degree of freedom of motion: roll uncertainty range is ±0.9 degrees, pitch uncertainty range is ±0.6 degrees, yaw uncertainty range is ±0.4 degrees, sway uncertainty range is ±0.3m, yaw uncertainty range is ±0.4m, and heave uncertainty range is ±0.2m. This six-DOF motion surrogate model is trained using an active learning strategy. After each training round, the model's prediction uncertainty for unlabeled samples is calculated. The 50 samples with the highest prediction uncertainty are selected, labeled for computational fluid dynamics simulation, and added to the training set for iteration until the model's root mean square error on the validation set is below 8% and the uncertainty estimation calibration error is below 5%.
[0116] like Figure 3As shown, technicians input the first 10 recalled knowledge items, their confidence scores, roll angle amplitude, pitch angle amplitude, bow angle amplitude, sway displacement amplitude, pitch displacement amplitude, heave displacement amplitude, motion uncertainty interval, and environmental parameters into the large language model for reasoning. The large language model generates a preliminary navigation condition assessment text containing a navigation risk level assessment, countermeasure recommendations, and speed adjustment recommendations. The preliminary assessment text indicates that the ship faces a moderate to high risk level under the current sea state conditions, with a significant wave height of 2.8m exceeding the safety threshold, and a roll angle amplitude of 8.5 degrees approaching the stability limit boundary under full load conditions. It recommends reducing the speed from 15.5 knots to the 12-13 knot range to reduce wave drag and roll response amplitude. It also recommends adjusting the course to an angle of 35-50 degrees with the main wave direction to optimize the ship's motion attitude, reminding the crew to strengthen the inspection of deck cargo lashing to prevent cargo displacement due to severe rolling, and suggesting close monitoring of sea state changes over the next 24 hours and timely adjustment of the speed plan.
[0117] Technicians extracted 15 key statements related to navigation safety judgments from the preliminary navigation condition assessment text and input them into an illusion suppression function for credibility calculation. The illusion suppression function calculates credibility scores based on three dimensions: knowledge item coverage, motion uncertainty interval width, and semantic consistency. Knowledge item coverage was calculated as 0.85, obtained by statistically analyzing the proportion of the number of semantically overlapping items with the preliminary assessment text among the top 10 knowledge items. Motion uncertainty interval width was calculated by normalizing and summing the differences between the upper and lower bounds of the motion uncertainty interval for each degree of freedom, resulting in a comprehensive uncertainty index of 0.18. Semantic consistency was measured using cosine similarity to measure the average similarity between the semantic vector of the preliminary assessment text and the semantic vectors of the top 10 knowledge items, yielding a score of 0.81. The illusion suppression function, combined with an improved Gaussian kernel function, performs weighted smoothing on the knowledge item confidence scores. The improved Gaussian kernel function introduces an adaptive bandwidth parameter to dynamically adjust the weight decay rate based on the semantic distance between knowledge items. The distribution of credibility scores for the 15 key statements after weighted calculation across the three dimensions is shown in Table 2.
[0118] Table 2. Distribution of Credibility Scores for Key Statements
[0119]
[0120] The system marked one key statement with a credibility score in the high-risk range as requiring manual review, as this statement involved insufficient knowledge support for structural strength assessment under extreme sea conditions. Three key statements with credibility scores in the medium-risk range underwent conservative revisions, reducing the certainty of their risk level descriptions. Eleven key statements with credibility scores in the safe range were retained, ultimately forming the navigation condition assessment report.
[0121] Based on the speed adjustment recommendations in the final navigation condition assessment report, technicians extracted a total voyage length of 920 km and a port arrival time constraint of 52 hours as optimization objectives. The total voyage length was divided into 14 time windows, each corresponding to a segment length of approximately 65.7 km. The system employed a particle swarm optimization algorithm to iteratively search for the optimal speed sequence that minimized fuel consumption while meeting the port arrival time constraint. The initial population size was 50 particles, with each particle's position vector representing the speed value across the 14 time windows and its velocity vector representing the speed search direction. The speed constraint range was set from a minimum safe speed of 8 knots to a maximum design speed of 18 knots. During the iteration process, the total fuel consumption and total voyage time for each particle's corresponding speed sequence were weighted and combined as the fitness function value. Total fuel consumption was calculated by substituting the speed value of each time window into the ship's main engine fuel consumption rate curve to obtain the fuel consumption per unit time, multiplying it by the time window length, summing it over all time windows, and then dividing by the theoretical maximum fuel consumption corresponding to the maximum design speed to obtain a normalized fuel consumption value of 0.72. The total travel time is calculated by dividing the total travel distance by the speed value for each time window, summing the travel times for each time window, and then normalizing by dividing by the minimum safe speed corresponding to the theoretical maximum travel time, resulting in a normalized travel time value of 0.65. The fitness function value is calculated by multiplying the normalized fuel consumption by a fuel weight coefficient of 0.7 and the normalized travel time by a time weight coefficient of 0.3. A linear decreasing inertia weight strategy is adopted, decreasing from 0.9 to 0.4 to balance global exploration and local exploitation capabilities. In the later stages of iteration, differential evolution mutation operations are introduced to perturb the current optimal particle and improve convergence accuracy. After 192 iterations, the fitness function value improvement is less than 0.1% for 20 consecutive generations. The system outputs an optimized speed sequence as the speed scheduling scheme, as shown in Table 3.
[0122] Table 3 Optimized speed sequence scheduling scheme
[0123]
[0124] like Figure 4 As shown, during the actual voyage, technicians followed the user operation process, opened the interactive interface according to requirements, selected the navigation area, and invoked marine environmental forecast products to generate environmental forecast information such as wind, waves, and ocean currents. This information was then input into the large model via prompts. The large model, based on the environmental forecast information, invoked the domain knowledge base to perform reasoning and obtain a navigation assessment report. Technicians reviewed the assessment report and, based on its recommendations, planned the route and speed to aid in decision-making. When the ship reached the 6th time window, technicians again invoked the system to obtain the latest marine environmental forecast data. They found that the sea conditions were continuing to improve, with the significant wave height decreasing to 2.1m and the horizontal average wind speed decreasing to 6.5m / s. The system then re-inferred and generated an updated assessment report, based on which the speed sequence for subsequent time windows was adjusted to further optimize fuel economy, ultimately ensuring the successful and timely completion of the voyage mission.
[0125] The technological advancements of this invention compared to traditional ship navigation decision-making methods are mainly reflected in the following aspects. The domain-adaptive embedding vector model maximizes the semantic similarity of positive sample pairs and minimizes the semantic similarity of negative sample pairs through a contrastive learning fine-tuning strategy, enhancing the semantic boundary recognition capability of ship domain terms. The hard negative sample mining mechanism selects training samples from semantically similar term pairs that express different professional concepts, enabling the model to accurately distinguish subtle semantic differences within the ship domain and avoiding knowledge retrieval bias caused by terminological ambiguity in traditional keyword matching methods. The six-degree-of-freedom motion surrogate model employs a Bayesian neural network framework, imposing probability distribution assumptions on network weights instead of traditional point estimation methods. It utilizes Monte Carlo sampling to generate multiple predictions from the learned posterior distribution of the weights, with the variance directly reflecting the model's cognitive uncertainty regarding the current input. Combined with an active learning strategy, after each training round, the model automatically selects the most uncertain samples for priority high-cost computational fluid dynamics simulation labeling. Compared to random sampling labeling strategies, this achieves higher model performance improvements under the same labeling budget. Through iterative loops, uncertainty estimation and data labeling decisions are tightly coupled, significantly enhancing the model's predictive ability for high-risk boundary areas in sea state space. Simultaneously, the model's output motion uncertainty range provides a quantitative credibility basis for subsequent navigation risk assessment, preventing the model from making overconfident and erroneous predictions based on inputs outside the training data distribution. The illusion suppression function evaluates the reliability of the large language model output from three dimensions: knowledge item coverage, width of the motion uncertainty interval, and semantic consistency. Combined with an improved Gaussian kernel function, an adaptive bandwidth parameter is introduced to dynamically adjust the weight decay rate based on the semantic distance between knowledge items. This ensures a more balanced contribution of semantically similar knowledge items to the credibility score. When factual or logical reasoning illusions exist in the large language model output, a clear risk warning is given, and erroneous information is prevented from being transmitted to the final report, guaranteeing the accuracy and safety of navigation decision recommendations. The particle swarm optimization algorithm balances global exploration and local exploitation capabilities through a linearly decreasing inertial weight strategy. In the later stages of iteration, differential evolution mutation operations are introduced to perturb the current optimal particle, improving convergence accuracy. Compared to traditional empirical speed adjustment methods, it can systematically optimize fuel consumption while meeting arrival time constraints. Simultaneously, by adjusting the fuel weight coefficient and time weight coefficient, it achieves a flexible trade-off between fuel economy and navigation timeliness.
[0126] It should be noted that the variables involved in this invention are explained in detail in Tables 4 and 5.
[0127] Table 4. Variable Explanation Table (Part 1)
[0128]
[0129] Table 5. Variable Explanation Table (Part Two)
[0130]
[0131] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for determining ship navigation conditions based on a large language model, characterized in that, The system acquires the ship's position coordinates to generate a query area, calls the marine environment forecasting interface to obtain raw environmental data and calculate environmental parameters, and simultaneously acquires the ship's real-time status parameters. It then converts the structured query statement into a semantic vector using a domain-adaptive embedding vector model, retrieving and recalling knowledge entries and confidence scores from a ship domain knowledge vector library. The system inputs the ship's real-time status parameters and environmental parameters into a six-DOF motion proxy model to predict the ship's motion amplitude and uncertainty interval. Finally, it inputs the knowledge entries, confidence scores, motion amplitude, uncertainty interval, and environmental parameters into a large language model to generate a preliminary navigation condition assessment text. Key statements are extracted and input into a hallucination suppression function to calculate a credibility score. Based on the credibility score, manual review is triggered, or key statements are retained to form the final navigation condition assessment report. Finally, based on the final navigation condition assessment report, a particle swarm optimization algorithm is used to search for and optimize the speed sequence.
2. The method according to claim 1, characterized in that, The domain-adaptive embedding vector model is trained on a dataset of ship terminology pairs using a fine-tuning strategy based on contrastive learning. It enhances the semantic boundary recognition capability of ship domain terms by maximizing the semantic similarity of positive sample pairs and minimizing the semantic similarity of negative sample pairs.
3. The method according to claim 2, characterized in that, The structure of the six-degree-of-freedom motion proxy model is as follows: the input layer receives real-time ship state parameters and environmental parameters, and after passing through a fully connected hidden layer, it outputs the predicted motion amplitude and the estimated uncertainty. The fully connected hidden layer uses a calibrated linear unit function as the activation function.
4. The method according to claim 3, characterized in that, The steps for establishing the training dataset for the six-degree-of-freedom motion proxy model are as follows: using computational fluid dynamics simulation software to generate six-degree-of-freedom motion time series data with different combinations of sea conditions and ship states, and performing Fourier transform on the time series data to extract the main frequency amplitude as the label value.
5. The method according to claim 4, characterized in that, The training of the six-degree-of-freedom motion surrogate model adopts a Bayesian neural network framework. During the training process, prior distribution constraints are applied to the network weights and posterior distribution parameters are learned through variational inference. An active learning strategy is used to select the sample with the highest prediction uncertainty for simulation labeling.
6. The method according to claim 5, characterized in that, The collaborative framework of uncertainty quantification and active learning based on Bayesian neural networks generates multiple prediction results from the posterior distribution of the weights by applying probability distribution assumptions to the neural network weights and using Monte Carlo sampling. The variance of the prediction results reflects the model's cognitive uncertainty about the current input.
7. The method according to claim 6, characterized in that, The illusion suppression function calculates a credibility score based on three dimensions: knowledge item coverage, motion uncertainty interval width, and semantic consistency. When the credibility score falls within the high-risk range, manual review is triggered, and when the credibility score falls within the medium-risk range, conservative corrections are made.
8. The method according to claim 7, characterized in that, The knowledge entry coverage rate is calculated as the proportion of the number of knowledge entries whose semantics overlap with the preliminary navigation condition assessment text to the total number of recalled entries. The motion uncertainty interval width is calculated by normalizing and summing the difference between the upper and lower bounds of the motion uncertainty interval.
9. The method according to claim 8, characterized in that, The execution of the particle swarm optimization algorithm includes initializing the population size to a number of particles, with each particle's position vector representing the speed value within a time window, employing a linearly decreasing inertial weight strategy to balance global exploration and local exploitation capabilities, and introducing differential evolution mutation operations in the later stages of iteration to improve convergence accuracy.
10. The method according to claim 9, characterized in that, The fitness function value is calculated by multiplying the normalized total fuel consumption by the fuel weight coefficient and the normalized total flight time by the time weight coefficient, and the sum of the fuel weight coefficient and the time weight coefficient is 1.