A ship navigation time prediction method based on multi-task learning
By combining multi-task learning with ship traffic flow and sailing time prediction tasks, and incorporating weather and waterway characteristics, the problem of inaccurate sailing time prediction in existing technologies is solved, achieving more accurate sailing time prediction and reducing the risk of overfitting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU SHULAN TECH CO LTD
- Filing Date
- 2023-01-11
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for predicting ship sailing times fail to adequately consider traffic flow, future weather conditions, and waterway characteristics, leading to inaccurate predictions and increased operating costs for ports and ship owners.
A multi-task learning approach is adopted, combining ship traffic flow prediction and navigation time prediction tasks. It incorporates future weather characteristics, upstream and downstream waterway correlation characteristics, and ship characteristics, and learns through the overall model framework to output future navigation times.
It improves the accuracy of sailing time prediction, reduces the probability of model overfitting, enhances generalization ability, and can more accurately predict future traffic flow conditions, thereby reducing operating costs for ports and ship owners.
Smart Images

Figure CN116307069B_ABST
Abstract
Description
A method for predicting ship sailing time based on multi-task learning Technical Field
[0001] This invention relates to the field of ship data processing technology, and in particular to a method for predicting ship sailing time based on multi-task learning. Background Technology
[0002] Ship sailing time estimation is an important basis for formulating port production and operation plans. However, there is still considerable uncertainty in ship sailing time forecasting. This will cause ports to be unable to execute the planned schedule, resulting in waste of manpower and resources, and increasing the operating costs of ports and ship owners.
[0003] Predicting ship travel time is similar to predicting vehicle arrival time in road traffic, but it also has its own unique characteristics. Currently, existing methods for predicting ship traffic flow and arrival time include historical averaging, models based on statistical learning methods, nonparametric regression models, and neural network models. For example, some researchers have constructed historical ship travel databases and used fuzzy matching-based point-to-point travel time prediction algorithms for inland waterway vessels to calculate ship travel times. Other researchers have used an improved DBSCAN algorithm to extract core trajectory segments of ships and predict arrival times by combining typical ship motion trajectories and ship speed.
[0004] With the development of artificial intelligence technology and the accumulation of ship AIS data, research on predicting ship traffic flow and sailing time using deep learning models is increasing. Some researchers have adopted the approach of segmented statistical processing of ship traffic flow, employing a spatiotemporal neural network model that combines dynamic and static features of the waterway to predict the sailing time of ships on planned routes. Other researchers have used a prediction method based on a multi-feature spatiotemporal graph convolutional network (MFSTGCN), starting from three features: traffic volume, average ship speed, and ship density. By utilizing spatial and temporal graph convolution operations, it effectively captures the spatiotemporal correlation of traffic density to predict the traffic density of ships in water transport.
[0005] For example, Chinese patent CN107316501B discloses a support vector machine (SVM) method for predicting travel time based on grid search. However, this method does not consider external features such as waterways, and the grid search method based on SVM is time-consuming. Another example is Chinese patent document CN111738500A, which discloses a deep learning-based method for predicting travel time. While this method incorporates features of the ship itself and the waterway, it does not consider the impact of traffic flow on travel time. Furthermore, current ship travel time prediction methods do not consider future weather conditions, which also have a certain impact on travel time. Summary of the Invention
[0006] This invention provides a ship navigation time prediction method based on multi-task learning. It utilizes the concept of multi-task learning and incorporates future weather features, upstream and downstream waterway correlation features, ship features, and waterway features into the model. By combining ship traffic flow prediction and ship navigation time prediction tasks, the learning process of the ship navigation time prediction model is guided, thereby achieving accurate prediction of ship navigation time.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] This invention provides a method for predicting ship sailing time based on multi-task learning, the prediction method comprising:
[0009] (1) Obtain historical AIS data;
[0010] (2) Process the historical AIS data into historical traffic flow and navigation time data for each channel and time period according to the divided channels, and collect weather data for each channel in the future period.
[0011] (3) Input historical traffic flow, flight time data and weather data into the traffic flow prediction sub-model and the flight time prediction sub-model for training;
[0012] (4) Construct the overall model framework;
[0013] (5) Train the overall model framework and output the final sailing time for each future route;
[0014] (6) The total travel time of the entire route is calculated by using rolling forecasting.
[0015] Furthermore, the historical AIS data includes longitude, latitude, time, ship MMSI number, heading, and speed, and its sources include shore-based AIS data and satellite AIS data.
[0016] Furthermore, the traffic flow prediction sub-model and the flight time prediction sub-model adopt time series prediction models, spatiotemporal graph convolutional models, or deep learning sequence models, such as LSTM, AutoFormer, Dlinear, etc.
[0017] Furthermore, the process of constructing the overall model framework in step (4) is as follows:
[0018] The model framework adopts a multi-task learning approach, jointly learning the tasks of ship traffic flow prediction and ship sailing time prediction. Then, by combining information about the waterway and the ship itself, it finally outputs the ship's future sailing time.
[0019] The ship's own characteristics are extended to each waterway and each time period, the waterway's own characteristics are extended to each time period, and the output results of the traffic flow prediction model and the sailing time prediction model are concatenated adjacently. Then, the waterway's own characteristics are transformed into one-dimensional features through the dimension of the fully connected layer.
[0020] Specifically: Assuming the output of the traffic flow prediction model is X F The dimension is (t, m), and the output X of the flight time prediction model is... T The dimension is (t, m), and the ship's own characteristics X S The quantity is a, and the waterway's own characteristics are X. C The dimension is (c, m), and the channel's own features X C Transform the dimension to X' using a fully connected layer. C =Linear(X) C ), whose dimension is (1, m), where t is the predicted sequence length, m is the number of channels, and c is the number of features of the channel itself; X' C These are the characteristics of the waterway after its own transformation;
[0021] Ship's own characteristics X S By repeating the original values to expand the dimensions, the ship's expanded feature X' is obtained. S =Extend(X S The dimension is expanded to (t, a), and the output of the traffic flow prediction model, the output of the navigation time prediction model, and the ship's own characteristics are concatenated along the t dimension. The concatenated feature dimension is (t, 2m+a), that is, the dimension of the predicted feature is (t, 2m+a).
[0022] The merged dimension (2m+a,m) is transformed to (t,m) through a fully connected layer, and then multiplied with the channel feature of dimension (1,m).
[0023] The final predicted flight time is X' T =Linear(Concat(X) F X T ,X' S ))*X′ C Sailing time prediction result X' T The dimension is (t, m).
[0024] Preferably, the fully connected layer is part of the overall model framework. The core operation of the fully connected layer is matrix-vector multiplication, which is essentially a linear transformation of the input features from one feature space to another.
[0025] Furthermore, the fully connected layers after feature merging employ dropout technology to improve the robustness of the overall model framework. After dropout, the output Linear(x) of the fully connected layers is:
[0026] Linear(x) = Wx + b;
[0027] Where W represents the weight value;
[0028] x represents the merged feature with dimension (2m+a, m);
[0029] b represents bias.
[0030] Furthermore, the specific training process in step (5) is as follows:
[0031] The loss value L of the overall model framework is obtained by weighted summing of the output losses of the flight time prediction submodel and the traffic flow prediction submodel. MTL The specific calculation formula is as follows:
[0032]
[0033] Among them, w i This represents the loss weights between the i-th flight time prediction sub-model and the traffic flow prediction sub-model;
[0034] L i This represents the loss value between the i-th sub-flight time prediction sub-model and the traffic flow prediction sub-model; if MSE loss is used, its calculation formula is:
[0035]
[0036] Where z represents the number of samples;
[0037] y′ i This represents the prediction results of the flight time prediction sub-model and the traffic flow prediction sub-model;
[0038] y i This represents the actual results of the flight time prediction sub-model and the traffic flow prediction sub-model.
[0039] Preferably, the navigation time prediction sub-model and the traffic flow prediction sub-model are time-series prediction-related models, such as LSTM, AutoFormer, Dlinear, etc. This scheme utilizes the idea of multi-task learning to combine ship traffic flow prediction and ship navigation time prediction tasks, without limiting the specific model used in the sub-models.
[0040] Furthermore, the specific process of step (6) is as follows:
[0041] (61) Input the destination and divide the route into channels 1 to n according to the channel division rules;
[0042] (62) Starting from the first channel, input the start time, call the overall model framework to output the predicted sailing time, and calculate the remaining sailing time based on the proportion of the remaining mileage in the channel.
[0043] (63) Determine the entry time of the next channel based on the sailing time of the previous channel, and then call the overall model framework to output the sailing time of the next channel;
[0044] (64) Repeat step (63) until the predicted travel time of the last segment is obtained, and calculate the remaining travel time based on the proportion of the remaining mileage in the channel.
[0045] (65) The total sailing time of the entire route is obtained by adding up the sailing times of each channel.
[0046] Furthermore, the ship's own characteristics include ship type, ship length, ship width, ship draft, and ship load capacity.
[0047] Furthermore, the characteristics of the waterway itself include waterway length, average waterway width, and average waterway depth.
[0048] The present invention has the following beneficial effects:
[0049] (1) This invention fully considers the impact of traffic flow on sailing time and adopts a multi-task learning approach to combine ship traffic flow prediction and ship sailing time prediction tasks to improve the generalization ability of the model. By sharing information from each task and complementing each other, the performance of each task is improved. Furthermore, since some parameters are shared, the probability of overfitting of the model is reduced.
[0050] (2) The present invention takes into account the impact of future weather conditions on sailing time and traffic flow, and more accurately predicts the future traffic flow conditions, thereby further accurately predicting the future sailing time of ships. Attached Figure Description
[0051] Figure 1 is a flowchart of the prediction method of the present invention.
[0052] Figure 2 is another flowchart of the prediction method of the present invention.
[0053] Figure 3 is a flowchart of the overall flight time prediction for the entire route according to the present invention. Detailed Implementation
[0054] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments are only specific illustrations of the invention and should not be regarded as limitations on the invention. The purpose of the embodiments is to enable those skilled in the art to better understand and reproduce the technical solution of the present invention. The scope of protection of the present invention should still be determined by the scope defined in the claims.
[0055] Compared to single-task learning, multi-task learning combines multiple related tasks in a certain way for simultaneous learning. For a complex problem, it can be decomposed into simple and independent sub-problems, solved individually, and then the results combined to obtain the final solution for the complex problem. However, in reality, many sub-problems are not independent but interconnected, linked by shared factors or representations. Multiple single-task learning ignores the rich interrelationships between problems, while multi-task learning improves performance by sharing information from each task and complementing each other; furthermore, because some parameters are shared, the probability of overfitting is reduced.
[0056] As shown in Figures 1-2, this invention provides a ship navigation time prediction method based on multi-task learning, the prediction method comprising:
[0057] S1. Obtain historical AIS data, which includes longitude, latitude, time, ship MMSI number, heading, and speed. The sources include shore-based AIS data and satellite AIS data.
[0058] S2 processes historical AIS data into historical traffic flow and navigation time data for each waterway and time period according to the divided waterways, and collects weather data for each waterway in the future period.
[0059] S3, input historical traffic flow, flight time data and weather data into the traffic flow prediction sub-model and the flight time prediction sub-model for training; the traffic flow prediction sub-model and the flight time prediction sub-model adopt time series prediction model, spatiotemporal graph convolution model or deep learning sequence model, such as LSTM, AutoFormer, Dlinear, etc.
[0060] S4. Construct the overall model framework by aligning and merging the outputs of the traffic flow prediction model, the navigation time prediction model, the ship's own characteristics, and the waterway's own characteristics, and inputting them into the fully connected layer of the overall model framework. The ship's own characteristics include ship type, ship length, ship width, ship draft, and ship load. The waterway's own characteristics include waterway length, waterway average width, and waterway average depth.
[0061] The process of building the overall model framework is as follows:
[0062] The model framework employs a multi-task learning approach, jointly learning ship traffic flow prediction and ship sailing time prediction tasks. By combining information from waterways and the ships themselves, it ultimately outputs the future sailing time of the ships. Ship features are extended to each waterway and time period, and waterway features are extended to each time period. The outputs of the traffic flow prediction model and the sailing time prediction model are concatenated, and then the waterway features are transformed into one-dimensional features through a fully connected layer. Specifically: assuming the output of the traffic flow prediction model is X... F The dimension is (t, m), and the output X of the flight time prediction model is... T The dimension is (t, m), and the ship's own characteristics X S The quantity is a, and the waterway's own characteristics are X. C The dimensions are c and m), and the channel's own features are X C Transform the dimension to X' using a fully connected layer. C =Linear(X) C ), whose dimension is (1, m), where t is the predicted sequence length, m is the number of channels, and c is the number of features of the channel itself; X' C Features of the waterway itself after conversion; Ship's own features X S By repeating the original values to expand the dimensions, the ship's expanded feature X' is obtained. S =Extend(X S The dimension is expanded to (t, a), and the output of the traffic flow prediction model, the output of the navigation time prediction model, and the ship's own characteristics are concatenated along the t dimension. The concatenated feature dimension is (t, 2m+a), that is, the dimension of the predicted feature is (t, 2m+a).
[0063] The merged dimension (2m+a,m) is transformed to (t,m) through a fully connected layer, and then multiplied with the channel feature of dimension (1,m).
[0064] The final predicted flight time is X' T =Linear(Concat(X) F X T ,X' S ))*X′ C Sailing time prediction result X′ T The dimension is (t, m).
[0065] Preferably, the fully connected layer is part of the overall model framework. The core operation of the fully connected layer is matrix-vector multiplication, which is essentially a linear transformation of the input features from one feature space to another.
[0066] Furthermore,
[0067] After merging features, the fully connected layers employ dropout technology to improve the robustness of the overall model framework. The output of the fully connected layers after dropout is Linear(x):
[0068] Linear(x) = Wx + b;
[0069] Where W represents the weight value;
[0070] x represents the merged feature with dimension (2m+a, m);
[0071] b represents bias.
[0072] S5 trains the overall model framework and outputs the final travel times for each future route. The specific process is as follows:
[0073] The loss value L of the overall model framework is obtained by weighted summing of the output losses of the flight time prediction submodel and the traffic flow prediction submodel. MTL The specific calculation formula is as follows:
[0074]
[0075] Among them, w i This represents the loss weights between the i-th flight time prediction sub-model and the traffic flow prediction sub-model;
[0076] L i Let represent the loss value between the i-th flight time prediction sub-model and the traffic flow prediction sub-model. If MSE loss is used, its calculation formula is:
[0077]
[0078] Where z represents the number of samples;
[0079] y′ i This represents the prediction results of the flight time prediction sub-model and the traffic flow prediction sub-model;
[0080] y i This represents the actual results of the flight time prediction sub-model and the traffic flow prediction sub-model.
[0081] Preferably, the navigation time prediction sub-model and the traffic flow prediction sub-model are time-series prediction-related models, such as LSTM, AutoFormer, Dlinear, etc. This scheme utilizes the idea of multi-task learning to combine ship traffic flow prediction and ship navigation time prediction tasks, without limiting the specific model used in the sub-models.
[0082] S6 uses a rolling forecasting method to calculate the total flight time for the entire route.
[0083] As shown in Figure 3, the specific process is as follows:
[0084] S61, Input the destination, and divide the route into channels 1 to n according to the channel division rules;
[0085] S62, starting from the first channel, input the start time, call the overall model framework to output the predicted sailing time, and calculate the remaining sailing time based on the proportion of the remaining mileage in the channel;
[0086] S63: Determine the entry time of the next channel based on the travel time of the previous channel, and then call the overall model framework to output the travel time of the next channel;
[0087] S64, repeat step S63 until the predicted travel time of the last segment is obtained, and calculate the remaining travel time based on the proportion of the remaining mileage in the channel.
[0088] S65 adds up the travel times of each channel to obtain the total travel time of the entire route.
[0089] This invention fully considers the impact of traffic flow on sailing time, and adopts a multi-task learning approach to combine ship traffic flow prediction and ship sailing time prediction tasks, thereby improving the model's generalization ability. By sharing information from various tasks and complementing each other, the performance of each task is improved. Furthermore, since some parameters are shared, the probability of overfitting in the model is reduced. The invention also considers the impact of future weather conditions on sailing time and traffic flow, and more accurately predicts future traffic flow conditions, thereby further improving the accuracy of future ship sailing time prediction.
[0090] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
Claims
1. A method for predicting ship sailing time based on multi-task learning, characterized in that, The prediction method includes: (1) acquiring historical AIS data; (2) processing the historical AIS data into historical traffic flow and navigation time data for each time period of each waterway according to the divided waterways, and collecting weather data for each waterway in the future period; (3) inputting the historical traffic flow, navigation time data and weather data into the traffic flow prediction sub-model and the navigation time prediction sub-model for training; (4) constructing an overall model framework, which adopts a multi-task learning approach to jointly learn the ship traffic flow prediction and ship navigation time prediction tasks, and then outputs the ship's future navigation time by combining waterway and ship information; specifically: assuming the output result X of the traffic flow prediction model is F The dimension is (t, m), and the output X of the flight time prediction model is... T The dimension is (t, m), and the ship's own characteristics X S The quantity is a, and the waterway's own characteristics are X. C The dimension is (c, m), and the channel's own features are X C Transform the dimension to X' using a fully connected layer. C =Linear(X C ), whose dimension is (1, m); where t is the predicted sequence length, m is the number of channels, c is the number of features of the channel itself, X' C Features of the waterway itself after conversion; Ship's own features X S By repeating the original values to expand the dimensions, the ship's expanded feature X' is obtained. S =Extend(X S The dimension is expanded to (t, a), and the outputs of the traffic flow prediction model, the navigation time prediction model, and the ship's own features are concatenated along the t dimension. The concatenated feature dimension is (t, 2m+a), that is, the predicted feature dimension is (t, 2m+a). A fully connected layer transforms the merged feature (2m+a, m) to (t, m), and then multiplies it with the transformed channel features (1, m). The final navigation time prediction result is... Sailing time prediction result X' T The dimension is (t, m); (5) Train the overall model framework and output the final sailing time of each future route; (6) Calculate the total sailing time of the entire route by using rolling prediction.
2. The ship navigation time prediction method based on multi-task learning according to claim 1, characterized in that, The historical AIS data includes longitude, latitude, time, ship MMSI number, heading, and speed, and its sources include shore-based AIS data and satellite AIS data.
3. The ship navigation time prediction method based on multi-task learning according to claim 1, characterized in that, The traffic flow prediction sub-model and the flight time prediction sub-model adopt a time series prediction model, a spatiotemporal graph convolution model, or a deep learning sequence model.
4. The ship navigation time prediction method based on multi-task learning according to claim 1, characterized in that, After merging features, the fully connected layers employ dropout technology to improve the robustness of the overall model framework. The output of the fully connected layers after dropout is Linear(x): Where W represents the weight value; x represents the merged feature with dimension (2m+a, m); and b represents the bias.
5. The ship navigation time prediction method based on multi-task learning according to claim 4, characterized in that, The specific training process in step (5) is as follows: the loss values of the overall model framework are calculated by weighted summation of the output losses of the flight time prediction sub-model and the traffic flow prediction sub-model. MTL The specific calculation formula is as follows: , where w i L represents the loss weights between the i-th flight time prediction sub-model and the traffic flow prediction sub-model; i Let represent the loss value between the i-th flight time prediction sub-model and the traffic flow prediction sub-model. If MSE loss is used, its calculation formula is: Where z represents the number of samples; y' i This represents the prediction results of the flight time prediction sub-model and the traffic flow prediction sub-model; y i This represents the actual results of the flight time prediction sub-model and the traffic flow prediction sub-model.
6. The ship navigation time prediction method based on multi-task learning according to claim 1, characterized in that, The specific process of step (6) is as follows: (61) Input the destination and divide the route into channels 1 to n according to the channel division rules; (62) Starting from the first channel, input the start time, call the overall model framework to output the predicted sailing time, and calculate the remaining sailing time according to the proportion of the remaining mileage in the channel. (63) Determine the entry time of the next channel based on the sailing time of the previous channel, and then call the overall model framework to output the sailing time of the next channel; (64) Repeat step (63) until the predicted sailing time of the last segment is obtained, and calculate the remaining sailing time based on the proportion of the remaining mileage in the channel; (65) Add the sailing times of each channel to obtain the total sailing time of the entire route.
7. The ship navigation time prediction method based on multi-task learning according to claim 1, characterized in that, The characteristics of the waterway itself include waterway length, average waterway width, and average waterway depth.
8. The ship navigation time prediction method based on multi-task learning according to claim 1, characterized in that, The ship's own characteristics include ship type, ship length, ship width, ship draft, and ship load capacity.
Citation Information
Patent Citations
A Support Vector Machine Travel Time Prediction Method Based on Grid Search
CN107316501B
Navigation time prediction method and device based on deep learning
CN111738500A
Ship track abnormity detection method based on navigation channel model
CN110210352A
Ship autonomous navigation auxiliary decision-making system
CN111339229A