Ship track prediction method based on text retrieval enhancement

By constructing a retrieval corpus and utilizing a dense paragraph detector and a retrieval generation network to generate multimodal features, the accuracy problem of ship trajectory prediction in complex environments in existing technologies has been solved, achieving more efficient trajectory prediction results.

CN121456579APending Publication Date: 2026-02-03THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511378295.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-25
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing maritime vessel trajectory prediction models struggle to accurately capture trajectory features in complex environments, especially since traditional mathematical models rely on historical data and deep learning models perform poorly in complex scenarios.

Method used

By constructing a retrieval corpus, utilizing a dense paragraph detector and a retrieval generation network, and combining textual and track information, multimodal features are generated and input into a track prediction network to achieve track prediction based on text retrieval enhancement.

Benefits of technology

It improves the accuracy and robustness of track prediction, enabling it to adapt to complex maritime vessel movement scenarios and generate more reliable future tracks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456579A_ABST
    Figure CN121456579A_ABST
Patent Text Reader

Abstract

The invention discloses a ship track prediction method based on text retrieval enhancement. The ship track prediction method comprises the following steps: step 1, constructing a retrieval corpus based on an original sample; step 2, based on the constructed corpus, retrieving through a dense paragraph detector to obtain an alternative historical sample set; 3, inputting the alternative historical sample set into the retrieval generation network to obtain response output text information; 4, extracting and fusing the text information retrieved in the step 3 and the historical track data in the step 1 to obtain target multi-modal features; and step 5, inputting the multi-modal features of the target into the track prediction network to obtain future track prediction of the target. Text modal information related to the ship is considered, and available data information and modals are expanded; the problem that the ship motion features can change along with the change of the relevancy of the retrieved text information is considered; the method can adapt to a complex maritime ship motion scene, and has good robustness; and the trajectory prediction accuracy is high.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of multi-modal processing, and in particular to a ship track prediction method based on text retrieval enhancement. BACKGROUND

[0002] Track prediction plays an important role in the fields of marine navigation, space navigation, intelligent transportation, etc. Accurate and efficient track prediction can effectively determine the ship's motion trajectory in ocean navigation, helping maritime workers to analyze the ship's motion trajectory and obtain relevant navigation information, so track prediction has high research value. At present, the track prediction model of the ship at sea mainly includes the method based on traditional mathematical model and the method based on deep learning. The method based on traditional mathematical model mainly includes kinematic model, dynamic model, statistical model, etc. The method based on deep learning mainly includes time series prediction deep neural network model, support vector machine, etc. This paper systematically describes the basic principles, use conditions and shortcomings of these methods, and proposes a ship track prediction method at sea combined with text retrieval.

[0003] The traditional mathematical statistical model uses the historical navigation track, time, speed and other data of the ship at sea to train, analyzes the mode and law of these historical data, constructs a mathematical model to fit these modes, and predicts the track of the ship at sea target in a certain time according to the model parameters and the current state. With the continuous input of new data, the parameters of the model are updated, so that the fitting effect of the model is better, and the prediction accuracy is higher. However, this method depends on a large amount of historical data, which is easy to affect the effect of new environment and object, and it is difficult to capture some complex motion track characteristics. The more complex deep neural network model can capture more complex rules of track by using deep feature extraction and nonlinear modeling. However, it is still difficult to predict the motion track and dynamic characteristics in some complex scenarios. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a ship track prediction method based on text retrieval enhancement.

[0005] In order to solve the above technical problems, the present application discloses a ship track prediction method based on text retrieval enhancement, comprising the following steps:

[0006] Step 1, constructing a retrieval corpus based on original samples;

[0007] Step 2, based on the constructed corpus, the candidate historical sample set is obtained by dense paragraph detector retrieval;

[0008] Step 3, inputting the candidate historical sample set into the retrieval generation network to obtain response output text information;

[0009] Step 4, extracting and fusing the text information retrieved in step 3 and the historical track data in step 1 to obtain target multi-modal features;

[0010] Step 5, inputting the target multi-modal features into a track prediction network to obtain a target future trajectory prediction.

[0011] The original sample includes text information of a ship, track information of the ship, ship text information query, and corresponding answers;

[0012] Each piece of text information corresponds to multiple query-answer pairs;

[0013] The text information includes ship description and attributes;

[0014] The track information includes longitude, latitude, speed, and direction.

[0015] The building and retrieving corpus in step 1 includes:

[0016] The original sample sequence is serialized to obtain an original sample sequence corpus, and the specific form is:

[0017]

[0018] In the formula, text is given ship text information, L is the length of the text, d is the dimension of the text vector, x t is the track information of the target at time t, including the longitude lat t , latitude lon t , ground speed sog t , and direction cog t of the target at time t, and (q, y) is a query-answer pair.

[0019] The dense paragraph detector in step 2 includes a query encoder and a history encoder, which generate answer encodings to capture the rich knowledge contained in the answers, and calculate whether the top n paragraphs most similar to the query retrieved contain the knowledge in the answers.

[0020] The training of the query encoder and the history encoder includes: based on the query-answer pair (q, y) of the given ship text information in the corpus, and the other m answers in the same batch, a training set is constructed, the original answer is taken as the positive example, and the other answers are taken as the negative example set Neg to train the model:

[0021] Neg={y (1) ,y (2) ,…,y (m)},

[0022] The conditional probability p ans(y|q) is:

[0023]

[0024] wherein: p(p i |q) is the probability of a given original sample query q getting an alternative historical sample p i , and σ(·) is a normalization function used to generate the probability;

[0025] The binary cross-entropy loss is used as the loss function L BCE , and the model is trained based on the training set, wherein y represents the predicted answer, and y' represents the expected answer:

[0026]

[0027] The dense passage detector is cascaded by a double-tower encoding part, i.e., a query encoder + a history encoder, and a knowledge distillation part, i.e., an auto-encoder + a knowledge extractor, and the specific combination mode is as follows:

[0028] 1) Double-tower encoding part:

[0029] The query encoder enc q and the history encoder enc p do not share weights, and respectively map the input question q and the corpus passage historical sample p i to the same semantic vector space; the original similarity sim(p i , q) is obtained by dot product, which is used for fast retrieval of Top-n passages;

[0030] 2) Knowledge distillation part:

[0031] Auto-encoder: taking "answer y" as the only input, after compression by the encoder, the intermediate hidden state k is extracted by the multi-head attention type knowledge extractor α as the "knowledge that the answer should have";

[0032] Knowledge extractor β: taking the splicing of "query q and each Top-n historical sample p i " as input, to generate the corresponding knowledge vector k'_i;

[0033] Knowledge alignment: using the MSE loss ||k-k'_i||2 2 to force k'_i to approach the reference k, so that the retrieved passage really contains knowledge that can support the answer, rather than surface keyword matching;

[0034] 3) Overall process:

[0035] (1) The double-tower encoding part first performs rough sorting and returns the Top-n text;

[0036] (2) The knowledge distillation part calculates the containing score s;

[0037] (3) Only keep the paragraph with s ≥ threshold (default 0.5) as the candidate historical sample set.

[0038] The candidate historical sample set is retrieved by the dense paragraph detector in step 2; specifically including:

[0039] Step 2-1, use the double tower encoding part to calculate the similarity between the original sample and the historical sample p i :

[0040] sim(p i , q) = enc q (q)Tenc p (p i )

[0041] In the formula: q is the ship text information query, p i is other text information in the corpus, i.e. the candidate historical sample, sim(·,·) is the similarity between samples, enc q is the query encoder, and enc p is the historical encoder.

[0042] Step 2-2, according to the similarity sim(p i , q) calculated in step 2-1, use the maximum inner product search to select the top n similar historical samples, and calculate the probability:

[0043]

[0044] In the formula: Top-n(P|q) is the top n candidate historical samples selected as historical samples for the given original sample query q;

[0045] Step 2-3, detect whether the top n similar historical samples retrieved in step 2-2 contain the answer to the ship text information query;

[0046] The answer refers to the "correct" or "target" knowledge fragment related to the given ship text information query (q). Specifically, it is a key element in the training process, used to build positive and negative sample pairs (positive example: original answer a; negative example: other m answers in the same batch). The answer contains rich ship-related knowledge (such as description, attributes, etc.), the purpose is to let the model extract and capture these knowledge from the retrieved historical samples, so as to enhance the accuracy of the track prediction. The answer is not a simple label, but a knowledge-rich representation, used to train the model to distinguish between correct and incorrect knowledge.

[0047] The judgment step in step 2-3 whether the answer to the ship text information query is contained is:

[0048] Step 2-3-1, concatenate the texts of the top-n historical samples retrieved into a long context:

[0049] C = [p1; p2;...; pn]

[0050] Step 2-3-2, knowledge distillation part: send the "answer" text y and C into the entailment model to calculate the entailment score s:

[0051] s = σ(encq(y) T encp(C)) ∈ [0, 1]

[0052] s: represents the entailment score of "whether the answer text y is contained in the context C", the value is between 0 and 1, the higher the value, the more likely the context C contains the information of the answer y;

[0053] σ: usually refers to the sigmoid function, used to map the inner product result to the [0, 1] interval, representing probability or confidence; encq(y): represents the encoding result of the query encoder on "answer text y", which is a vector;

[0054] encp(C): represents the encoding result of the history encoder on "concatenated context C", which is also a vector;

[0055] T: represents vector transposition, used to calculate the dot product (inner product) between two vectors, measuring their similarity.

[0056] Step 2-3-3, set threshold (default 0.5):

[0057] If s ≥ 0.5 → marked as "contains answer";

[0058] If s < 0.5 → marked as "does not contain answer".

[0059] The text entailment model is based on the dual-flow coding idea, aiming to let the answer and the context paragraph first conduct independent and deep semantic modeling. Specifically, the answer text y and the concatenated query C are respectively encoded by two parameter-shared Transformer encoders, obtaining their respective high-dimensional semantic vector representations. Then, the system concatenates these two vectors to fuse information from both sources. Finally, the concatenated vector is mapped to a scalar logic value (logit) through a single neuron fully connected layer (i.e. a linear transformation), and the entailment probability can be further converted by the Sigmoid function.

[0060] The retrieval generation network described in step 3 is a BART generator, which splices the Top-n candidate historical sample set retrieved in step 2 and the text query q of the current ship as an overall context as the input of the BART generator, and concatenates the previously generated token sequence y :t-1 As the decoder end of the BART generator:

[0061] To obtain a knowledge-containing response output through the retrieval generation network, specifically:

[0062]

[0063] wherein BART([q; p i ], y :t-1 ) is the query q, the historical sample p i and the label y :t-1 of the previous t-1 time input to the BART-based generator, and GenerateResponse(·) is the final response text y text output by sampling the response output according to the model output probability.

[0064] Step 4 is to fuse the retrieved response text and the track information to obtain a multi-modal feature, specifically:

[0065] Step 4-1, a text encoder based on attention is used to encode the output response text to obtain a text modal feature, specifically:

[0066] z text = enc text (y text )

[0067] wherein enc text is a text encoder, y text is the response output of step 3, and z text is the text modal feature;

[0068] Step 4-2, the original track information is encoded using discrete embedding to obtain a track modal feature; each attribute of the track information is discretized, specifically:

[0069]

[0070] wherein lat t , lon t , sog t and cog t respectively represent the latitude, longitude, speed over ground and direction of the target at t time, ToIndex lat (·), ToIndex lon (·) and ToIndexsog (·) and ToIndex cog (·) means converting the real-valued track attribute into a discrete index value and Discretized attributes are passed through an embedding network and spliced to form the final track modal feature, which is specifically:

[0071]

[0072] In the formula: Embedding lat (·), Embedding lon (·), Embedding sog (·) and Embedding cog (·) is the embedding network that converts the discrete index of the track attribute into a high-dimensional embedding and is the final track modal feature;

[0073] Step 4-3, fuse the text modal feature and the track modal feature to obtain the final multi-modal feature, which is specifically:

[0074]

[0075] Step 5 is to use the target multi-modal feature and the track prediction network to realize the final trajectory prediction, which is specifically:

[0076] Step 5-1, input the text track multi-modal fusion feature obtained in step 4-3 into the constructed track prediction network to obtain the target historical representation, which is specifically:

[0077] h t = φ(z 1:t-1 )

[0078] In the formula: φ(·) is a track prediction network based on self-attention mechanism, h t is the target historical representation up to time t;

[0079] Step 5-2, pass the target historical representation obtained in step 5-1 through the classification head to obtain the logits of each attribute at future time t, which is specifically:

[0080]

[0081] In the formula: and are the logits of the corresponding discrete values of the longitude, latitude, ground speed and angle at time t, respectively, and ψ(·) is the classification head.

[0082] Step 5-3, normalize the attribute probability distribution obtained in step 5-2, optimize the track prediction network using cross-entropy loss, further sample and restore to real value, obtain the attribute value of the target at future time t, and the specific form is:

[0083]

[0084] In the formula: and are the attribute prediction values of longitude, latitude, ground speed and angle of the target at time t respectively, Softmax(·) is a normalization function, and ToValue(·) is a process of sampling and restoring real value according to the given probability value;

[0085] The track prediction network is optimized using cross-entropy, and the specific form is:

[0086]

[0087] In the formula: CE(·,·) is the cross-entropy loss, and respectively represent the discrete attribute labels of the target at time t.

[0088] Beneficial effects:

[0089] (1) The text modal information related to the ship is considered, the available data information and modal are expanded; (2) The problem that the ship motion characteristics change with the relevance of the retrieved text information is considered; (3) It can adapt to complex sea ship motion scenes and has good robustness; (4) The trajectory prediction accuracy is high. BRIEF DESCRIPTION OF DRAWINGS

[0090] Figure 1 The algorithm flowchart of the application. DETAILED DESCRIPTION

[0091] The scene of the embodiment is:

[0092] Suppose there is a cargo ship "Ocean Star", which needs to perform track prediction in the sea area near the port, so as to optimize the route planning and avoid potential collision. The present case uses the track prediction method based on text retrieval enhancement described in the patent to predict the future track of "Ocean Star".

[0093] A ship track prediction method based on text retrieval enhancement, comprising the following steps:

[0094] Step 1, constructing a retrieval corpus based on original samples;

[0095] Step 2, based on the constructed corpus, retrieve the candidate historical sample set through the dense paragraph detector;

[0096] Step 3: Input the alternative historical sample set into the retrieval generation network to obtain response output text information;

[0097] Step 4: Extract and fuse the text information retrieved in Step 3 and the historical track data in Step 1 to obtain target multi-modal features;

[0098] Step 5: Input the target multi-modal features into the track prediction network to obtain target future trajectory prediction.

[0099] The original sample includes text information of the ship, track information, ship text information query, and corresponding answers;

[0100] Each piece of text information corresponds to multiple query-answer pairs;

[0101] The text information includes: ship description and attributes;

[0102] The track information includes: longitude, latitude, speed, and direction.

[0103] Example of original sample in this embodiment:

[0104] 1. Text information:

[0105] Ship description: Haixing Star is a bulk carrier with a deadweight tonnage of 50,000 tons, a length of 200 meters, a maximum speed of 15 knots, a registry in China, and a construction year of 2018.

[0106] Ship attributes: The ship type is a bulk carrier, the power system is a diesel engine, the maximum cargo capacity is 50,000 tons, and the navigable sea area is nearshore and open sea.

[0107] 2. Track information:

[0108] Track data at time t: longitude 120.5°E, latitude 30.2°N, speed 12 knots, heading 90° (east).

[0109] 3. Ship text information query and corresponding answers:

[0110] Query 1: What is the typical speed of Haixing Star when sailing in nearshore waters?

[0111] Answer: According to historical records, the typical speed of Haixing Star when sailing in nearshore waters is 10-12 knots.

[0112] Query 2: Has the heading of Haixing Star changed significantly in the past 24 hours?

[0113] Answer: In the past 24 hours, the heading of Haixing Star has changed from 85° to 90°, which is a small change.

[0114] Query 3: What kind of ship is the Ocean Star and what is its carrying capacity suitable for which routes?

[0115] Answer: The Ocean Star is a bulk carrier suitable for both nearshore and oceanic bulk cargo transportation routes, with a carrying capacity of 50,000 tons.

[0116] The search corpus constructed in Step 1 includes:

[0117] The original sample is serialized to obtain the original sample sequence corpus, with the specific form being:

[0118]

[0119] In the formula, text is the given ship text information, L is the text length, d is the text vector dimension, x t is the target track information at time t, including the target's longitude lat t , latitude lon t , ground speed sog t and direction cog t , and (q, y) is the query-answer pair.

[0120] In this embodiment, the text information (description and attributes), track information (longitude and latitude, speed, direction) of "Ocean Star", and query-answer pair are serialized to construct the corpus, as shown in the following example:

[0121] Text information sequence: { "Ship Description": bulk carrier, carrying capacity 50,000 tons, length 200 meters...};

[0122] Track information sequence: { t time: (120.5°E, 30.2°N, 12 knots, 90°)};

[0123] Query-answer pair: { Query 1: Typical speed, Answer: 10-12 knots; Query 2: Change in heading, Answer: from 85° to 90°...}.

[0124] The dense passage detector in Step 2 includes a query encoder and a history encoder, which are used to generate answer encodings and calculate whether the top n passages retrieved as the most similar to the query contain the knowledge in the answer.

[0125] The training of the query encoder and the history encoder includes: based on the query-answer pair (q, y) of the given ship text information in the corpus, and the other m answers in the same batch, a training set is constructed, the original answer is taken as the positive example, and the other answers are taken as the negative example set Neg to train the model:

[0126] Neg = { y (1) , y (2) , …, y (m)},

[0127] Conditional probability p of generating positive or negative example answer y given a given boat information problem q ans (y|q) is:

[0128]

[0129] where: p(p i |q) is the probability of getting candidate historical sample p i given original sample query q, and σ(·) is a normalization function for generating probability;

[0130] Use binary cross-entropy loss as loss function L BCE , train the model based on the training set, y represents the predicted answer, and y' represents the expected answer:

[0131]

[0132] The dense passage detector is cascaded by a double-tower encoding part, i.e., query encoder + history encoder, and a knowledge distillation part, i.e., auto-encoder + knowledge extractor.

[0133] 1) Double-tower encoding part:

[0134] The query encoder enc q and the history encoder enc p do not share weights, and respectively map the input question q and the corpus passage historical sample p i to the same semantic vector space; the original similarity sim(p i , q) is obtained by dot product, which is used for fast retrieval of Top-n passages;

[0135] 2) Knowledge distillation part:

[0136] Auto-encoder: with "answer y" as the only input, after compression by the encoder, the multi-head attention knowledge extractor α extracts the intermediate hidden state k as the "knowledge that the answer should have" benchmark;

[0137] Knowledge extractor β: with "splicing of query q and each Top-n historical sample p i " as input, generate the corresponding knowledge vector k'_i;

[0138] Knowledge alignment: use MSE loss ||k-k'_i||2 2 to force k'_i to approach the benchmark k, so that the retrieved passage really contains knowledge that can support the answer, rather than surface keyword matching;

[0139] 3) Overall process:

[0140] (1) The double-tower encoding part performs coarse ranking and returns the top-n text;

[0141] (2) The knowledge distillation part calculates the implication score s;

[0142] (3) Only the passages with s≥threshold (default 0.5) are retained as the candidate historical sample set.

[0143] In this embodiment, the input query "typical speed of Marine Star" is calculated by dot product to calculate the similarity with the historical samples in the corpus, and the top-n (n=5) most similar historical samples are retrieved, such as historical records containing similar ship types and sailing speeds. Ensure that these samples contain knowledge of the query answer (for example, records containing "10-12 knots" sailing speed).

[0144] The candidate historical sample set retrieved by the dense passage detector in step 2 is described; specifically including:

[0145] Step 2-1, use the double-tower encoding part to perform coarse ranking to calculate the similarity between the original sample and the historical sample p i :

[0146] sim(p i ,q)=enc q (q)Tenc p (p i )

[0147] where q is the ship text information query, p i is other text information in the corpus, i.e., the candidate historical sample, sim(·,·) is the similarity between samples, enc q is the query encoder, and enc p is the historical encoder;

[0148] Step 2-2, according to the similarity sim(p i ,q) calculated in step 2-1, use the maximum inner product search to select the top-n most similar candidate historical samples, and calculate the probability:

[0149]

[0150] where: Top-n(P|q) is the top-n candidate historical samples selected as historical samples for the given original sample query q;

[0151] Step 2-3, detect whether the top-n similar historical samples retrieved in step 2-2 contain the answer to the ship text information query.

[0152] The judgment step in step 2-3 whether the answer to the ship text information query is contained is:

[0153] Step 2-3-1, concatenate the texts of the top-n historical samples retrieved into a long context:

[0154] C = [p1; p2;...; pn]

[0155] Step 2-3-2, knowledge distillation part: send the "answer" text y and C into the entailment model to calculate the entailment score s:

[0156] s = σ(encq(y) T encp(C)) ∈ [0, 1]

[0157] s: represents the entailment score of "whether the answer text y is contained in the context C", the value is between 0 and 1, the higher the value, the more likely the context C contains the information of the answer y;

[0158] σ: usually refers to the sigmoid function, used to map the inner product result to the [0, 1] interval, representing probability or confidence; encq(y): represents the encoding result of the query encoder on the "answer text y", which is a vector;

[0159] encp(C): represents the encoding result of the history encoder on the "concatenated context C", which is also a vector;

[0160] T: represents vector transposition, used to calculate the dot product between two vectors to measure their similarity.

[0161] Step 2-3-3, set threshold:

[0162] If s ≥ 0.5 → marked as "contains answer";

[0163] If s < 0.5 → marked as "does not contain answer".

[0164] The retrieval generation network is a BART generator, which concatenates the top-n candidate historical sample set retrieved in step 2 and the current ship text query q into an overall context as the input of the BART generator, and the previously generated token sequence y :t-1 as the decoder side condition of the BART generator:

[0165] To get the knowledge-containing response output through the retrieval generation network, specifically:

[0166]

[0167] where: BART([q; p i ], y :t-1 ) is the query q, historical sample p i and the label y :t-1Input to the BART-based generator, GenerateResponse(·) outputs the final response text y by sampling the response output according to the model output probability text ,

[0168] The output of this embodiment is: According to the historical pattern, the Ocean Star is expected to sail eastward at a speed of 12 knots.

[0169] Step 4 is to fuse the retrieved response text and track information to obtain multi-modal features, specifically:

[0170] Step 4-1, using an attention-based text encoder to encode the output response text to obtain text modal features, the specific form is:

[0171] z text =enc text (y text )

[0172] In the formula, enca text is a text encoder, y text is the response output of step 3, and z text is the text modal feature;

[0173] Step 4-2, using discrete embedding to encode the original track information to obtain track modal features; each attribute of the track information is discretized respectively, and the real-valued track attribute is changed to a discrete index value and The discretized attribute is passed through an embedding network to form the final track modal feature z t ;

[0174] Step 4-3, fuse the text modal feature and the track modal feature to obtain the final multi-modal feature, the specific form is:

[0175]

[0176] In this embodiment,

[0177] The response text "Ocean Star is expected to sail eastward at a speed of 12 knots" is encoded using an attention-based text encoder to obtain the text modal feature; the track information (longitude 120.5°E, latitude 30.2°N, speed 12 knots, heading 90°) is discretized and embedded to generate the track modal feature. Through fusion operation (such as weighted splicing or attention mechanism), the text modal feature and the track modal feature are combined to generate the multi-modal feature.

[0178] The multimodal feature is input into a track prediction network (based on a self-attention mechanism) to generate a target historical representation. The logits of the longitude, latitude, speed and heading at the future time are calculated by a classification head, and are normalized and sampled to predict the track at the future time. For example: the predicted result is that the track of the ocean star at t+1 is (longitude 120.6°E, latitude 30.2°N, speed 12.5 knots, heading 92°). The track prediction network is optimized using cross-entropy loss, and iterative prediction is performed until a specified time length is reached to generate a complete track.

[0179] The output result is obtained:

[0180] The finally predicted track is:

[0181] • At t+1: (120.6°E, 30.2°N, 12.5 knots, 92°)

[0182] • At t+2: (120.7°E, 30.2°N, 12.7 knots, 93°)

[0183] •...

[0184] The present application improves the accuracy of track prediction by combining text information (ship description, attributes, query-answer pairs) and track information (longitude, latitude, speed, direction). Compared with traditional methods, the present method can better capture historical patterns and semantic knowledge, and generate more reliable future tracks, which is suitable for port scheduling, route optimization and other scenarios.

[0185] The present application provides a ship track prediction method based on text retrieval enhancement. There are many methods and approaches to implement this technical solution. The above description is only the preferred embodiment of the present application. It should be noted that for ordinary technical personnel in this technical field, without departing from the principles of the present application, several improvements and refinements can be made, which should also be considered within the protection scope of the present application. The components not explicitly described in the present embodiment can be implemented using existing technology.

Claims

1. A method for predicting ship tracks based on text retrieval enhancement, characterized in that, Includes the following steps: Step 1: Construct a retrieval corpus based on the original samples; Step 2: Based on the constructed corpus, a set of candidate historical samples is obtained by using a dense paragraph detector; Step 3: Input the candidate historical sample set into the retrieval generation network to obtain the response output text information; Step 4: Extract and fuse the text information retrieved in Step 3 and the historical track data from Step 1 to obtain the target multimodal features; Step 5: Input the target's multimodal features into the trajectory prediction network to obtain the target's future trajectory prediction.

2. The method for predicting ship tracks based on text retrieval enhancement according to claim 1, characterized in that, The original samples include text information about the ships, track information, ship text information queries, and corresponding answers; Each text message corresponds to multiple query-answer pairs; The text information includes: vessel description and attributes; The flight path information includes: latitude and longitude, speed, and direction.

3. The method for predicting ship tracks based on text retrieval enhancement according to claim 2, characterized in that, The construction of the retrieval corpus in step 1 includes: The original samples are serialized to obtain the original sample sequences, which are then used to construct the corpus. Specifically, the corpus is as follows: In the formula, text is the given ship text information, L is the text length, d is the text vector dimension, and x is the length of the text vector. t It is the target's trajectory information at time t, including the target's longitude at time t. t latitude t Ground speed sog t with direction cog t , where (q,y) is the query-answer pair.

4. The method for predicting ship tracks based on text retrieval enhancement according to claim 3, characterized in that, The dense paragraph detector described in step 2 includes a query encoder and a history encoder. The query encoder and history encoder are used to generate answer codes, and it is calculated whether the top n most similar paragraphs to the query contain the knowledge in the answer.

5. The method for predicting ship tracks based on text retrieval enhancement according to claim 4, characterized in that, The training of the query encoder and history encoder includes: based on the corpus, for a given ship text information query-answer pair (q,y), constructing a training set with the other m answers in the same batch, using the original answer as a positive example and the other answers as a negative example set Neg to train the model: Neg={y (1) ,and (2) ,…,and (m) }, Calculate the conditional probability p of producing positive and negative example answers y when given a question q about ship information. ans (y|q) is: In the formula: p(p i |q) is the query q given the original sample to obtain the alternative historical sample p. i The probability is σ(·), which is the normalization function used to generate the probability; Using binary cross-entropy loss as the loss function L BCE The model is trained based on the training set, where y represents the predicted answer. ' Indicates the expected answer:

6. The method for predicting ship tracks based on text retrieval enhancement according to claim 5, characterized in that, The dense paragraph detector is composed of a cascaded dual-tower encoding part and a knowledge distillation part; the dual-tower encoding part includes a query encoder and a history encoder, and the knowledge distillation part includes an autoencoder and a knowledge extractor.

7. The method for predicting ship tracks based on text retrieval enhancement according to claim 6, characterized in that, Step 2, which involves retrieving a set of candidate historical samples using a dense paragraph detector, specifically includes: Step 2-1: First, use the dual-tower coding part to coarsely calculate the p of the original sample and the historical sample. i Similarity: sim(p i ,q)=enc q (q)I have p (p i ) In the formula: q is the ship text information query, p i These are other textual information in the corpus, i.e., candidate historical samples. sim(·,·) represents the similarity between samples, and enc... q It is a query encoder, enc p It is a history encoder; Step 2-2, based on the similarity sim(p) calculated in step 2-1 i Using the maximum inner product search, select the top n candidate historical samples with the highest similarity (q), and calculate their probabilities: In the formula: Top-n(P|q) represents the top n candidate historical samples selected by query q for a given original sample as historical samples; Step 2-3: Check whether the first n similar historical samples retrieved in Step 2-2 contain the answer to the query for the ship's text information.

8. The method for predicting ship tracks based on text retrieval enhancement according to claim 7, characterized in that, The steps for determining whether the query for the ship's text information contains the answer in steps 2-3 are as follows: Step 2-3-1: Concatenate the text of the top-n retrieved historical samples into a long context: C = [p1; p2; ...; pn] Step 2-3-2, Knowledge Distillation: Feed the "answer" text y along with C into the implication discriminant model to calculate the implication score s: s=σ(encq(y) T encp(C))∈[0,1] s: represents the implication score of "whether the answer text y is contained in the context C", with a value between 0 and 1. The higher the value, the more likely the context C is to contain information about the answer y. σ: usually refers to the sigmoid function, which is used to map the inner product result to the interval [0,1], representing probability or confidence level; encq(y): represents the encoding result of the query encoder for "answer text y", which is a vector; encp(C): Represents the encoding result of the historical encoder on "concatenated context C", which is also a vector; T: Represents the transpose of a vector, used to calculate the dot product between two vectors and measure their similarity; Step 2-3-3, set the threshold: If s ≥ threshold → mark as "contains answer"; If s < threshold, mark it as "does not contain answer".

9. The method for predicting ship tracks based on text retrieval enhancement according to claim 3, characterized in that, The retrieval generation network described in step 3 is a BART generator. It concatenates the Top-n candidate historical sample set retrieved in step 2 with the current ship's text query q to form the overall context, which is then used as input to the BART generator. This is further supported by the previously generated token sequence y. :t-1 Conditions for the decoder side of the BART generator: To obtain a knowledge-integrated response output through a retrieval-generating network, specifically: In the formula: BART([q; p) i ],y :t-1 ) is the query q, historical sample p i Label y at time t-1 :t-1 The input is fed into a BART-based generator, and GenerateResponse() samples the response based on the model's output probability to obtain the final response text y. text .

10. A method for predicting ship tracks based on text retrieval enhancement according to claim 4, characterized in that, Step 4 involves fusing the retrieved response text and track information to obtain multimodal features, specifically: Step 4-1: Encode the output response text using an attention-based text encoder to obtain text modal features, specifically in the following form: z text =enc text (y text ) In the formula, enca text For text encoders, y text For the response output of step 3, z text Text modal features; Step 4-2: Use discrete embedding to encode the original track information to obtain track modal features; Each attribute of the track information is discretized, transforming real-valued track attributes into discrete index values. and Discretized attributes are embedded into a network and then concatenated to form the final track modality feature z. t ; Step 4-3: Fuse text modal features and track modal features to obtain the final multimodal features, specifically in the following form: