A black box identification modeling and motion prediction method for ship motion based on stacking model fusion

Through the ship motion black box identification modeling method based on stacking model fusion, combined with LSTM, SVM and XGBoost, the complexity and over-fitting problems of ship motion modeling in the existing technology are solved, and higher-precision ship motion prediction is achieved, improving ensure maritime security.

CN114357872BActive Publication Date: 2024-10-22WUHAN UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111594714.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2024-10-22
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

Among the existing black-box ship motion modeling methods, a single algorithm has limitations such as complex training process, long time and over-fitting, making it difficult to build a high-precision ship motion model, especially the accuracy of motion prediction in waves is insufficient.

Method used

A ship motion black box identification modeling method based on stacking model fusion is adopted, using LSTM, SVM and XGBoost as base learners, combined with K-fold cross validation and linear regression, to build a more accurate ship motion black box identification model, integrating three base learners advantages to improve fitting and generalization capabilities.

Benefits of technology

It improves the accuracy and efficiency of ship motion attitude prediction, obtains higher-precision forecast results, and provides more effective guarantee for safe operation of ships at sea.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114357872B_ABST
    Figure CN114357872B_ABST
Patent Text Reader

Abstract

The present invention provides a ship motion black box identification modeling and motion prediction method based on stacking model fusion, wherein the ship motion black box identification modeling method comprises: S1 obtaining the motion data of the ship through a sensor, S2: preprocessing the obtained motion data of the ship, S3: using the K-fold cross validation method to generate a trained base learner based on a training set, and inputting a test set into the trained base learner, respectively obtaining the prediction results of the three trained base learners on the test set; S4: using the prediction results of the three trained base learners on the test set as the feature value of the next layer of meta learner, using the true value as a label, and using a linear regression method to construct a meta learner as a ship motion black box identification model. The present invention combines the advantages of several base learners, has strong fitting ability and good generalization ability, and improves the prediction accuracy and efficiency of the ship motion posture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ship motion modeling and prediction, and in particular to a ship motion black box identification modeling and motion prediction method based on stacking model fusion. Background Art

[0002] Trade between countries is becoming more and more frequent under the influence of the globalization of the world economy, and the volume of cargo transportation is constantly increasing. As the main force of cargo transportation, ships are developing towards large-scale, specialized and diversified development, and the complexity and difficulty of ship operation are also increasing. When ships sail on the sea, they will inevitably be affected by various environmental factors, such as wind, waves, currents, and shore effects, and the ships themselves have various control systems and power systems. Therefore, the motion state of ships at sea is extremely complex. It is particularly important to build an accurate model for them to simulate and predict motion, analyze motion characteristics, and design appropriate controllers, observers and other motion system modules.

[0003] At present, the method of ship maneuvering motion mathematical model plus computer simulation is an extremely practical and effective method for predicting and evaluating ship maneuverability during the ship design stage. Establishing an accurate mathematical model of ship motion, using simulation technology to simulate actual scenes, and predicting and simulating ship motion is an effective solution for studying ship maneuverability and seakeeping. Identification modeling technology is a modeling method that uses identification algorithms to determine model parameters based on the selected model structure and takes into account the generalization ability of the model. Applying system identification technology to model and predict the motion of ships in waves can supplement traditional prediction methods and enrich the technical means of predicting the motion of ships in waves. Moreover, system identification technology can be directly used to model and predict the motion of real ships in waves, thereby avoiding the influence of scale effects and improving the accuracy of motion prediction.

[0004] Many scholars at home and abroad have achieved important research results in the field of ship motion identification modeling, and its development routes are divided into white box modeling, black box modeling and gray box modeling. Among them, black box modeling has great advantages in use because it does not need to clearly know the mathematical model of the modeling object. The general steps of black box modeling are to obtain the data required for modeling through simulation or actual ship experiments, and the collected data cannot usually be used directly. It is necessary to process the data according to the needs of the algorithm to obtain data that meets the requirements of the algorithm. The processed data is input into the machine learning method for training to establish a model of ship motion. Due to the deviation of the simulation model, the simulated data needs to be debugged to obtain good identification results. Commonly used machine learning methods in black box modeling include neural networks, decision trees, support vector machines (SVMs), etc. Among them, the neural network method has the problems of complex training process and long time, and although the decision tree has improved in speed, it is prone to overfitting. There are limitations in the application of a single algorithm to establish a black box model. Summary of the invention

[0005] In order to conveniently build a high-precision ship motion model and model and predict the motion of the ship in the waves, a black-box identification modeling method for ship motion based on stacking model fusion is provided, a more accurate and adaptable prediction model (black-box identification model of ship motion) is constructed, and a ship motion prediction method is provided, which can realize the prediction of the ship motion in the waves and make the prediction result more accurate.

[0006] The technical solution of the present invention is as follows:

[0007] The first aspect provides a black box identification modeling method for ship motion based on stacking model fusion, comprising:

[0008] S1: Obtain the ship's motion data through sensors, including the ship's speed, heading, rudder angle information and sea conditions during recording, and calculate the steering angular velocity based on the ship's speed and heading;

[0009] S2: preprocessing the acquired ship motion data, and dividing the preprocessed data into two parts, the first part includes a training set and a test set, and the second part is a verification set;

[0010] S3: Select LSTM, SVM and XGBoost as base learners, use K-fold cross validation method to generate trained base learners based on the training set, and input the test set into the trained base learners to obtain the prediction results of the three trained base learners on the test set, where the input data of the base learners are the current steering angular velocity and rudder angle information, and the output data is the steering angular velocity at the next moment;

[0011] S4: The prediction results of the three trained base learners on the test set are used as the feature values ​​of the next layer of meta-learner, the true values ​​are used as labels, and the meta-learner is constructed using linear regression as a black box identification model for ship motion.

[0012] In one embodiment, in step S1, the mathematical model of ship motion with single degree of freedom of steering is used as the identification target, wherein the mathematical model of ship motion with steering is:

[0013]

[0014] Where, T represents the steering time constant, K is the rudder angle gain, n3 is the nonlinear term coefficient, n1 is the coefficient about ship stability, and r represents the steering angular velocity;

[0015] The Euler method is used to discretize the mathematical model of ship motion. The discretized mathematical model is:

[0016]

[0017] Among them, Δr(k+1) represents the change of the steering angular velocity of the k+1 sampling point relative to the steering angular velocity of the k sampling point, Δr(k) represents the change of the steering angular velocity of the k sampling point relative to the steering angular velocity of the k-1 sampling point, Δt represents the time interval between the k sampling point and the k-1 sampling point, n3, n1, Δδ(k) represents the change of the rudder angle of the k sampling point relative to the rudder angle of the k-1 sampling point.

[0018] In one embodiment, step S2 pre-processes the acquired motion data of the ship, including:

[0019] Eliminate outliers from the acquired ship motion data to generate valid initial data;

[0020] Normalize the valid initial data.

[0021] In one embodiment, the Hampel filtering method is used to remove outliers from the acquired ship motion data. The effective initial data includes the ship steering angle and rudder angle information in the form of an input-output pair consisting of Z(k) and Δr(k+1).

[0022] Δr(k+1)=θZ(k)

[0023] Z(k)=[Δr(k) 3 ,Δr(k),Δδ(k)] T

[0024] Among them, Δr(k+1) is the output, which represents the change of the steering angular velocity of the k+1 sampling point relative to the steering angular velocity of the k sampling point, θ is the linear relationship between the input and output, and Z(k) is the input, which contains Δr(k) 3 , Δr(k) and Δδ(k), Δr(k) represents the change of the steering angular velocity of the k sampling point relative to the steering angular velocity of the k-1 sampling point, and Δδ(k) represents the change of the rudder angle of the k sampling point relative to the rudder angle of the k-1 sampling point.

[0025] In one embodiment, the valid initial data is normalized, including

[0026]

[0027] Among them, x is the valid initial data, x min is the minimum value in x, x max is the maximum value in x, and x' is the normalized data.

[0028] In one embodiment, S3 adopts a K-fold cross-validation method, where the K value is selected as 5, specifically: the first part of the data is divided into 5 equal parts, 1 part is used as a test set, and the remaining 4 parts are used as training sets to train the base learner; each cross-validation includes using the training set to train the model and predicting the test set based on the trained model; repeat the cross-validation 5 times, combine the predictions of the test set each time, and obtain the final prediction result.

[0029] In one embodiment, a validation set is used to validate the constructed ship motion black box identification model, and the mean square error (MSE) and root mean square error (RMSE) are used to evaluate the results.

[0030] Based on the same inventive concept, the second aspect of the present invention provides a ship motion prediction method, which inputs the data to be predicted as feature values ​​into the ship motion black box identification model constructed in the first aspect to obtain a prediction result.

[0031] The above one or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:

[0032] The ship motion black box identification modeling method based on stacking model fusion provided by the present invention adopts stacking model fusion to construct a ship motion black box model, which can integrate the advantages of three base learners, has strong fitting ability and good generalization ability, can make the prediction result better than that of a single learner, and improves the prediction accuracy and efficiency of the ship motion posture.

[0033] The present invention also provides a prediction method based on a black box identification model of ship motion, which can be used to predict the motion of an unknown ship in waves. Compared with traditional ship prediction methods, higher-precision prediction results can be obtained, providing more effective protection for the safe operation of ships at sea, which has engineering application significance. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 A flow chart of the black box identification modeling method for ship motion based on stacking model fusion provided by the present invention;

[0036] Figure 2 A schematic diagram of the stacking black box modeling of the present invention;

[0037] Figure 3 Comparison chart of the predicted results and actual results of the training set and test set data using stacking black box modeling;

[0038] Figure 4 This is a comparison chart of the predicted results and actual results of the validation set data using stacking black box modeling. DETAILED DESCRIPTION

[0039] The invention discloses a ship motion black box identification modeling method based on stacking model fusion, and the specific steps are as follows: step 1, data acquisition: obtaining ship motion data through sensors, including ship speed, heading and rudder angle information and sea conditions during recording; step 2, data preprocessing: removing wild values ​​from the collected ship motion data, generating valid initial data by calculation, and normalizing the valid data. Then the valid initial data is divided into a training set, a test set and a verification set for model learning, training and verification; step 3, fusion model construction: selecting LSTM, SVM and XGBoost as base learners, using the preprocessed data as the input and output data of the base learner, and using the k-fold cross validation method to divide the data under the same ship maneuvering into a test set and a training set to construct the base learner. The data under the manipulation of another ship is used as a verification set; step 4, ship motion black box identification modeling: using the prediction result of the base learner as the feature value of the next layer of meta learner, using the true value as the label, and using the linear regression method to construct the meta learner, so as to complete the ship motion box identification modeling based on stacking model fusion. Data for another vessel under manoeuvre.

[0040] A prediction method is also provided. For the prediction of data under another ship's maneuvering, that is, the prediction of the validation set data, the validation set data is input as feature values ​​into the constructed ship motion black box identification model based on stacking model fusion to obtain the prediction value. The mean square error (MSE) and root mean square error (RMSE) are used to evaluate the results.

[0041] The present invention combines the advantages of several base learners by constructing a stacking black box model, which has strong fitting ability and good generalization ability, can make the prediction result better than that of a single learner, and improves the prediction accuracy and efficiency of the ship's motion posture.

[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] The embodiment of the present invention provides a first aspect of a ship motion black box identification modeling method based on stacking model fusion, comprising:

[0044] S1: Obtain the ship's motion data through sensors, including the ship's speed, heading, rudder angle information and sea conditions during recording, and calculate the steering angular velocity based on the ship's speed and heading;

[0045] S2: preprocessing the acquired ship motion data, and dividing the preprocessed data into two parts, the first part includes a training set and a test set, and the second part is a verification set;

[0046] S3: Select LSTM, SVM and XGBoost as base learners, use K-fold cross validation method to generate trained base learners based on the training set, and input the test set into the trained base learners to obtain the prediction results of the three trained base learners on the test set, where the input data of the base learners are the current steering angular velocity and rudder angle information, and the output data is the steering angular velocity at the next moment;

[0047] S4: The prediction results of the three trained base learners on the test set are used as the feature values ​​of the next layer of meta-learner, the true values ​​are used as labels, and the meta-learner is constructed using linear regression as a black box identification model for ship motion.

[0048] See also Figure 1 , which is a flow chart of the ship motion black box identification modeling method based on stacking model fusion provided by the present invention. Step S1 is data acquisition, S2 is data preprocessing, including outlier removal, normalization and data set division, S3 is fusion model construction, and S4 is the construction of the ship motion black box identification model.

[0049] Specifically, the motion data of the ship obtained comes from different ship maneuvers, which can include data obtained from the 20° / 20°z-type experiment and the 10° / 10°z-type experiment of the same ship. The first part of the data contains a training set and a test set, which are used to build a black box model (ship motion black box identification model), and the second part is a verification set, which is used to verify the generalization of the established black box model.

[0050] In one embodiment, in step S1, the mathematical model of ship motion with single degree of freedom of steering is used as the identification target, wherein the mathematical model of ship motion with steering is:

[0051]

[0052] Where, T represents the steering time constant, K is the rudder angle gain, n3 is the nonlinear term coefficient, n1 is the coefficient about ship stability, and r represents the steering angular velocity;

[0053] The Euler method is used to discretize the mathematical model of ship motion. The discretized mathematical model is:

[0054]

[0055] Among them, Δr(k+1) represents the change of the steering angular velocity of the k+1 sampling point relative to the steering angular velocity of the k sampling point, Δr(k) represents the change of the steering angular velocity of the k sampling point relative to the steering angular velocity of the k-1 sampling point, Δt represents the time interval between the k sampling point and the k-1 sampling point, n3, n1, Δδ(k) represents the change of the rudder angle of the k sampling point relative to the rudder angle of the k-1 sampling point.

[0056] In one embodiment, step S2 pre-processes the acquired motion data of the ship, including:

[0057] Eliminate outliers from the acquired ship motion data to generate valid initial data;

[0058] Normalize the valid initial data.

[0059] In one embodiment, the Hampel filtering method is used to remove outliers from the acquired ship motion data. The effective initial data includes the ship steering angle and rudder angle information in the form of an input-output pair consisting of Z(k) and Δr(k+1).

[0060] Δr(k+1)=θZ(k)

[0061] Z(k)=[Δr(k) 3 ,Δr(k),Δδ(k)] T

[0062] Among them, Δr(k+1) is the output, which represents the change of the steering angular velocity of the k+1 sampling point relative to the steering angular velocity of the k sampling point, θ is the linear relationship between the input and output, and Z(k) is the input, which contains Δr(k) 3 , Δr(k) and Δδ(k), Δr(k) represents the change of the steering angular velocity of the k sampling point relative to the steering angular velocity of the k-1 sampling point, and Δδ(k) represents the change of the rudder angle of the k sampling point relative to the rudder angle of the k-1 sampling point.

[0063] Specifically, the specific implementation method of Hampel filtering is: for each sample, take a window consisting of the sample and the six samples around it, three on each side. Calculate the median m of this window data i and standard deviation σ i , for each data X in the window s Find the absolute median difference, that is, |X s -m i |, compare the absolute median difference and 3σ i If the absolute median difference is greater than 3σ i , then use the median m i Replace data X sOtherwise, the original data will be retained.

[0064] In one embodiment, the valid initial data is normalized, including

[0065]

[0066] Among them, x is the valid initial data, x min is the minimum value in x, x max is the maximum value in x, and x' is the normalized data.

[0067] In one embodiment, S3 adopts a K-fold cross-validation method, where the K value is selected as 5, specifically: the first part of the data is divided into 5 equal parts, 1 part is used as a test set, and the remaining 4 parts are used as training sets to train the base learner; each cross-validation includes using the training set to train the model and predicting the test set based on the trained model; repeat the cross-validation 5 times, combine the predictions of the test set each time, and obtain the final prediction result.

[0068] See also Figure 2 , a schematic diagram of the stacking black box modeling of the present invention. By ensuring that every data is involved in the training through K-fold cross validation, as much effective information as possible can be obtained from limited data. And it reflects the benefit of non-repeated sampling, which can reduce overfitting to a certain extent.

[0069] The existing methods for ship motion black box identification modeling and prediction either optimize one learner or mix two methods to achieve better modeling accuracy. The advantage of this method is that it can combine the advantages of three base learners, and if necessary, the number of base learners can be increased to obtain a more accurate model and more accurate prediction.

[0070] Specifically, the construction of the fusion model in step 3 includes three base learners, which are implemented as follows: the data in the first part are input into LSTM, SVM and XGBoost respectively for regression training. LSTM and SVM use normalized data, and since the tree model does not require normalized input data, XGBoost uses unnormalized data.

[0071] A long short-term memory network LSTM is built. The network contains three gate structures, namely the forget gate, input gate, and output gate. The first step of LSTM is to determine what information will be discarded from the node state. This step is determined by the forget gate, which is controlled by the sigmoid gate. It will pass or partially pass according to the output of the previous moment. The forget gate outputs f t as follows:

[0072] f t =σ(Wf ·[h t-1 ,x t ]+b f ), where W f is the weight matrix between the hidden layer and the output layer, b f is the bias of the output layer, h t-1 is the transmission state at time t-1, that is, the hidden state, x t is the state of the transfer state cell at time t.

[0073] The input gate consists of two parts. One part uses the sigmoid function to decide which values ​​to update, denoted as i t ; The other part uses the tanh function to generate new candidate values, denoted as C t . They are output as follows:

[0074] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0075] C t =tanh(W c ·[h t-1 ,x t ]+b c )

[0076] Where σ represents the sigmoid function, W i and W both represent weight matrices, b i and b c Both represent offset.

[0077] The current cell state is input by the forget gate f t The product of the state at the previous moment plus the product of the two parts of the input gate is expressed as C t ,Right now

[0078] C t =f t ·C t-1 +i t ·C t

[0079] Finally, the output gate stage runs a sigmoid gate to determine the output of the cell state, and the cell state is processed by tanh and multiplied by the sigmoid gate output to obtain the final output part h t .

[0080] o t =σ(W o ·[h t-1 ,xt ]+b o )

[0081] h t =o t ·tanh(c t )

[0082] In the formula, o t is the output of the sigmoid gate, W o represents the weight, b o is the bias of the sigmoid gate.

[0083] Establish an SVM regression model. SVR is suitable for obtaining the global optimal value through regression prediction under limited samples, and has good generalization ability for unknown samples. The principle is to determine the function expression by mapping the function into a high-dimensional space for linear regression:

[0084] Where ω is the weight coefficient vector in the feature space, is the mapping from low dimension to high dimension, and b is the bias value.

[0085] In order to reduce the risk of overfitting and the impact of outliers, the insensitive function ε and the slack variable ξ are introduced. i and i * And the regularization parameter C, the regression problem is optimized as follows:

[0086]

[0087] st(b+W T X i )-y i ≤ε+ξ i ,i=1,2,...,n

[0088] y i -(b+W T X i )≤ε+ξ i ,i=1,2,...,n

[0089] ξ i ≥0,ξ i * ≥0, i=1,2,...,n

[0090] By introducing Lagrange multipliers and defining the Lagrange function, it is transformed into a dual problem that is equivalent to the original problem and easier to solve. At the same time, the kernel function is introduced to obtain the linear function as follows:

[0091] Where α n and α n* is the Lagrange multiplier, n is the number of support vectors, K(x n ,x) is the kernel function.

[0092] Build an XGBoost tree model. XGBoost is an additive model composed of k base models. Assume that the tree model to be trained in the tth iteration is f t (x), then:

[0093] in is the prediction result of sample i after the tth iteration, is the prediction result of the first t-1 trees, f t (x i ) is the model of the t-th tree.

[0094] The loss function can be expressed as and the true value y i It is expressed as follows:

[0095] Where n is the number of samples, is the loss function between the i-th predicted value and the true value.

[0096] The objective function is defined as follows:

[0097] in The complexity of all t trees is summed up and added to the objective function as a regularization term to prevent the model from overfitting. The model's prediction value for the i-th sample is:

[0098] in, is the predicted value given by the t-1 step model, f t (x i ) is the predicted value of the new model.

[0099] The prediction results of SVM and LSTM are denormalized according to the following formula: x' = x' pred (x max -x min )+x min , where x' is the denormalized result, x' pred is the prediction result of the base learner, x max is the maximum value in the original data, x min is the minimum value in the original data.

[0100] In one embodiment, a validation set is used to validate the constructed ship motion black box identification model, and the mean square error (MSE) and root mean square error (RMSE) are used to evaluate the results.

[0101] The modeling method provided by the present invention is introduced below through specific examples.

[0102] First, perform step 1: obtain the ship's motion data through sensors, including the ship's speed, heading, rudder angle information, and sea conditions information at the time of recording, and calculate the turning angular velocity based on the ship's speed and heading;

[0103] Then, step 2 is performed: preprocessing the acquired ship motion data, and the preprocessed data is divided into two parts, the first part includes a training set and a test set, and the second part is a verification set;

[0104] Then execute step 3: select LSTM, SVM and XGBoost as base learners, use the K-fold cross-validation method to generate trained base learners based on the training set, and input the test set into the trained base learners to obtain the prediction results of the three trained base learners for the test set. The input data of the base learner is the current steering angular velocity and rudder angle information, and the output data is the steering angular velocity at the next moment.

[0105] All three base learners perform grid search to select the optimal parameters, and the best parameters obtained after tuning are shown in Table 1.

[0106] Table 1 Parameter settings for three base learning

[0107]

[0108] Then execute step 4: use the prediction results of the three trained base learners on the test set as the feature values ​​of the next layer of meta-learners, use the true values ​​as labels, and use linear regression to construct the meta-learner as a black box identification model for ship motion.

[0109] Table 2 summarizes the evaluation indicators of the prediction results of the three base learners and the prediction results of the stacking method. It can be seen that the prediction accuracy of the forecasting method provided by the present invention is improved to a certain extent compared with the other two methods, and it can provide interval predictions with probability distribution significance while obtaining high-precision point prediction results.

[0110] Table 2 Evaluation indicators of four prediction methods

[0111]

[0112] The evaluation indicators in Table 2 are calculated as follows: MSE is the mean square error, unit (° 2 ), and its calculation formula is:

[0113]

[0114] RMSE is the root mean square error, unit (°), and its calculation formula is:

[0115]

[0116] Among them, N is the total number of samples tested, y i is the predicted value, Y i is the true value.

[0117] See also Figure 3 and Figure 4 , Figure 3 A comparison chart of the predicted results and actual results for the first part of data (including training set and test set data) using stacking black box modeling; Figure 4 This is a comparison chart of the predicted results and actual results of the second part of data (validation set data) using stacking black box modeling. Among them, r_train represents the actual value of the steering angular velocity of the training set, r_train_pred represents the predicted value of the steering angular velocity of the training set, r_validation represents the actual value of the steering angular velocity of the validation set, and r_validation_pred represents the predicted value of the steering angular velocity of the validation set.

[0118] from Figure 3 It can be seen that the predicted results and the actual results of the first part of the data basically overlap. Figure 4 It can be seen that the predicted results and the actual results of the validation set data are also basically overlapping, which can show that the method of the present invention has achieved a high accuracy. Figure 3 and Figure 4 For the results, please refer to the actual examination reference. Compared with the prior art, the present invention adopts stacking model fusion to construct a black box model of ship motion, and predicts the motion of ships in waves with unknown mathematical models. Compared with traditional ship forecasting methods, it can obtain more accurate forecast results, provide more effective protection for the safe operation of ships at sea, and has engineering application significance.

[0119] Embodiment 2

[0120] Based on the same inventive concept as that of the first embodiment, this embodiment discloses a ship motion prediction method, in which the data to be predicted is input as a feature value into the ship motion black box identification model constructed in the first embodiment to obtain a prediction result.

[0121] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A black box identification modeling method for ship motion based on stacking model fusion, characterized in that: include: S1: Obtain the ship's motion data through sensors, including the ship's speed, heading, rudder angle information and sea conditions during recording, and calculate the steering angular velocity based on the ship's speed and heading; S2: preprocessing the acquired ship motion data, and dividing the preprocessed data into two parts, the first part includes a training set and a test set, and the second part is a verification set; S3: Select LSTM, SVM and XGBoost as base learners, use K-fold cross validation method to generate trained base learners based on the training set, and input the test set into the trained base learners to obtain the prediction results of the three trained base learners on the test set, where the input data of the base learners are the current steering angular velocity and rudder angle information, and the output data is the steering angular velocity at the next moment; S4: The prediction results of the three trained base learners on the test set are used as the feature values ​​of the next-layer meta-learner, and the true values ​​are used as labels. The meta-learner is constructed using linear regression as a black box identification model for ship motion; In step S1, the mathematical model of ship motion with single degree of freedom of steering is used as the identification target, wherein the mathematical model of ship motion with steering is: in, represents the steering time constant, K is the rudder angle gain, is the nonlinear term coefficient, is the coefficient about the stability of the ship, represents the steering angular velocity; The Euler method is used to discretize the mathematical model of ship motion. The discretized mathematical model is: in, represents the change in the steering angular velocity of the k+1 sampling point relative to the steering angular velocity of the k sampling point, represents the change in the steering angular velocity of the k sampling point relative to the steering angular velocity of the k-1 sampling point, represents the time interval between the k sampling point and the k-1 sampling point, It represents the change of the rudder angle at sampling point k relative to the rudder angle at sampling point k-1; Step S2 pre-processes the acquired motion data of the ship, including: Eliminate outliers from the acquired ship motion data to generate valid initial data; Normalize the valid initial data.

2. The ship motion black box identification modeling method according to claim 1, characterized in that: The Hampel filtering method is used to remove outliers from the acquired ship motion data. The effective initial data includes the ship steering angle and rudder angle information, which are in the form of and The input-output pair is composed of in, As output, it represents the change in the steering angular velocity of the k+1 sampling point relative to the steering angular velocity of the k sampling point, is the linear relationship between input and output, As input, it contains , and The matrix of represents the change in the steering angular velocity of the k sampling point relative to the steering angular velocity of the k-1 sampling point, It represents the change of the rudder angle at sampling point k relative to the rudder angle at sampling point k-1.

3. The ship motion black box identification modeling method according to claim 1, characterized in that: Normalize the valid initial data, including: in, is the valid initial data, is the minimum value in x, is the maximum value in x, is the normalized data.

4. The ship motion black box identification modeling method according to claim 1, characterized in that: S3 uses the K-fold cross-validation method, with a K value of 5. Specifically, the first part of the data is divided into 5 equal parts, 1 part is used as the test set, and the remaining 4 parts are used as training sets to train the base learner; each cross-validation includes using the training set to train the model and predicting the test set based on the trained model; repeat the cross-validation 5 times, combine the predictions of the test set each time, and get the final prediction result.

5. The ship motion black box identification modeling method according to claim 1, characterized in that: The method also includes using a validation set to validate the constructed ship motion black box identification model, and using mean square error (MSE) and root mean square error (RMSE) to evaluate the results.

6. A motion prediction method for ship motion black box identification based on stacking model fusion, characterized in that: The data to be predicted is input as a feature value into the black box identification model of ship motion constructed according to any one of claims 1 to 4 to obtain a prediction result.