Ship motion prediction compensation method based on domain adaptive transfer learning

Through the method based on field adaptive transfer learning, the heterogeneity of ship roll motion is solved, and the problem of insufficient prediction accuracy and stability in the prior art is achieved, and high-precision roll motion prediction is achieved.

CN119911397APending Publication Date: 2025-05-02SHANGHAI MARITIME UNIVERSITY
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510037710.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict and handle the heterogeneity of ship rolling motion under different sea conditions, especially when wave frequency and direction changes dramatically, resulting in insufficient prediction accuracy and stability.

Method used

Using a method based on domain adaptive transfer learning, ship motion data is collected in real time through sensors, time similarity quantification is performed, data is divided into source domain and target domain, and the pre-trained domain adaptive transfer learning model is used for processing, and ship roll motion prediction data at future moments are output.

Benefits of technology

It realizes high-precision prediction of ship rolling motion under different sea conditions, improves the prediction accuracy and stability, and ensures good operating performance of ships under different sea conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119911397A_ABST
    Figure CN119911397A_ABST
Patent Text Reader

Abstract

The invention provides a ship motion prediction and compensation method based on domain adaptive transfer learning, and aims to solve the prediction and compensation problems of rolling motion of a service workboat in offshore wind power construction under complex sea conditions. According to the method, ship rolling angle data are collected in real time through a sensor, and time similarity quantitative division is carried out on the data to divide the data into source domain motion data and target domain motion data. And then, processing the data by using a domain adaptive transfer learning model, and predicting ship rolling motion at a future moment. The prediction result and actual data are subjected to inverse kinematics solution to obtain the expansion and contraction amount of the six electric cylinders of the Stewart platform, the expansion and contraction amount is fed back to a ship control system, the ship attitude is adjusted in real time, and the operation safety and efficiency are improved. According to the method, model parameters can be dynamically adjusted according to feature differences under different sea conditions, the prediction precision is remarkably improved, the method is suitable for rolling motion prediction and compensation under variable sea conditions, and improvement of the safety and stability of SOV operation is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of ship rolling motion prediction, and in particular relates to a ship motion prediction and compensation method based on domain adaptive transfer learning. Background Art

[0002] During the construction of offshore wind power, the service operation vessel (SOV) is an important platform for the installation and maintenance of offshore wind power, and is responsible for the installation, maintenance, and transportation of personnel and materials of wind turbines. However, the complexity of the marine environment and the impact of waves have a significant impact on the operating efficiency and safety of SOVs, especially the roll motion (SOV-RM) of SOVs. Roll refers to the rotational movement of the hull around the longitudinal axis, usually caused by waves. Its amplitude and frequency change with the changes in sea conditions, resulting in threats to the stability of the ship and the safety of personnel and equipment. Therefore, how to deal with and predict SOV-RM, especially in complex sea conditions, has become an important issue in offshore wind power construction.

[0003] The force of waves on SOV can be described by the wave spectrum. The wave spectrum reflects the energy distribution of waves of different frequencies, which affects the sway and attitude of the ship. In actual sea conditions, the roll motion of SOV is closely related to factors such as wave frequency and wave direction. When the frequency of waves is close to the natural frequency of SOV, resonance may be induced, resulting in intensified roll motion. In addition, the direction of waves will also affect the roll motion torque of the hull. In the case of following waves, the force of waves on the hull is relatively small, while in the case of transverse waves and head waves, the impact of waves is more significant, which may result in a larger roll angle. Therefore, the frequency and direction of waves are the main factors affecting SOV-RM.

[0004] Under different sea conditions, there are significant differences in wave frequency, wave direction and its energy distribution, which makes the performance of SOV-RM show obvious heterogeneity. The heterogeneity of rolling motion can be divided into intra-sequence heterogeneity and inter-sequence heterogeneity. Intra-sequence heterogeneity refers to the distribution shift of SOV-RM over time in the same time period, which is usually manifested as changes in the amplitude and period of rolling motion caused by changes in wave frequency. Inter-sequence heterogeneity refers to the fact that under different sea conditions, due to the different frequencies and directions of waves, there are large differences in the performance of rolling motion under different sea conditions. This heterogeneity makes it difficult for traditional prediction methods to accurately model and predict SOV-RM, especially when the wave conditions are complex and changing dramatically.

[0005] The wave spectrum describes the energy distribution of waves of different frequencies and is usually divided into different sea state levels (such as sea state 3-6). The wave spectrum characteristics are different in each sea state. For example, in higher sea state levels, the frequency range of waves is wider and the peak frequency is lower. Changes in the wave spectrum directly affect the roll response of the SOV. For example, within the frequency range of the wave, when the frequency is close to the natural frequency of the ship, resonance may be induced, increasing the roll angle. The different wave spectra under different sea conditions lead to different performances of the SOV-RM, which is also one of the reasons for the heterogeneity of the roll motion.

[0006] At present, the research on SOV-RM mainly focuses on the establishment of wave force and ship response model. Traditional methods usually calculate the impact of waves on SOV based on wave spectrum and ship response function (RAO). However, these methods often cannot effectively capture the changing laws of rolling motion when facing different sea conditions and complex wave conditions, especially they cannot deal with the heterogeneity problems caused by changes in wave frequency and different wave angles. In addition, the existing models are insufficient in prediction accuracy and stability when facing changing sea conditions, which makes it difficult to meet the needs of actual engineering.

[0007] Therefore, how to solve the heterogeneity problem of roll motion and improve the prediction accuracy of SOV-RM on this basis has become a key technical challenge to promote the smooth construction of offshore wind power. Summary of the invention

[0008] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a ship motion prediction and compensation method based on domain adaptive transfer learning.

[0009] The purpose of the present invention can be achieved by the following technical solutions:

[0010] The present invention provides a ship motion prediction and compensation method based on domain adaptive transfer learning, comprising the following steps:

[0011] The ship motion data is collected in real time by sensors, wherein the ship motion data includes the ship rolling angle at each time point;

[0012] The ship motion data is quantitatively divided based on time similarity, and the ship motion data is divided into source domain motion data and target domain motion data;

[0013] The source domain motion data and the target domain motion data are input into the pre-trained domain adaptive transfer learning model for processing, and the predicted ship rolling motion data at the future moment is output;

[0014] Perform kinematic inverse analysis on the collected ship motion data and the predicted ship roll motion data to obtain the extension and retraction amounts of the corresponding sampling points of the six electric cylinders of the Stewart platform;

[0015] The obtained extension and contraction amounts of the corresponding sampling points of the six electric cylinders of the Stewart platform are fed back to the ship control system to adjust the ship movement in real time.

[0016] Furthermore, the ship rolling angle at each time point is:

[0017]

[0018] Among them, φ(ω,α) is the roll angle of the ship, ω is the angular frequency, α is the wave direction angle, F(ω) is the force of the wave, d is the arm of the ship's roll rotation, I is the ship's moment of inertia, B is the roll damping coefficient, σ is the imaginary unit, and C is the ship's restoring moment coefficient.

[0019] Furthermore, the quantitative division of the time similarity of the ship motion data specifically includes the following steps:

[0020] Given any T time points t1≤…≤t T , in [0,t1],··[t T-1 t T ], the rolling motion observed in each time period is defined as the unit area D1, D2…D T It is expressed as:

[0021]

[0022] in, is the ship rolling motion data at the i-th time point in time period l, is the predicted value of the ship's rolling motion at the i-th time point in time period l, N l is the number of time points in time period l, X l , Y l They represent the ship rolling motion data space and predicted value space in time period l respectively;

[0023] According to the obtained unit domains D1, D2...D T , select the time period [t1t2…t T-1 Any time point t in j (j∈{1,2,…,T-1}), merge the first j unit domains into the source domain D s =[D1,D2,…,D j ], and then Tj unit domains are merged into the target domain D t =[D j+1 ,D j+2 ,…,D T ];

[0024] For each pair of source domains D sand target area D t , calculate its distribution offset, the distribution offset of each domain pair can be expressed as:

[0025] L dm (D s ,D t ) = d adv (X s ,X t )

[0026] Among them, X s , X t Represents the source domain D s and target area D t The ship rolling motion data space in the distribution offset metric d(X s ,X t ) is calculated using the adversarial training algorithm, and the calculation formula is:

[0027] d adv (X s ,X t )=-E([log[G(X s )]]+[log[1-G(X t )]])

[0028] Among them, E(·) represents the expected value of the distribution function, and G(·) is a discriminant network used to determine whether the data belongs to the source domain data;

[0029] Through the time similarity quantization algorithm, find the pair of source domain motion data D with the largest distribution offset among the domain pairs of T-1 combinations. s and the target domain motion data D t , and its calculation process is described by the following formula:

[0030]

[0031] Furthermore, the domain adaptive transfer learning model includes: a single-layer decoder and encoder structure, wherein the encoder includes a multi-head attention mechanism module, a feedforward network and a domain adaptive module, and the decoder includes a masked multi-head attention mechanism module, a multi-head attention mechanism module and a feedforward network.

[0032] Furthermore, the source domain motion data and the target domain motion data are input into the domain adaptive transfer learning model for processing, and the processing process includes:

[0033] Position encoding is performed on the source domain motion data and the target domain motion data to obtain the roll motion data integrated with the time information;

[0034] The position-encoded source and target domain data are input into the encoder for feature extraction. The encoder extracts the temporal features of the source and target domains through a multi-head attention mechanism and a feedforward neural network, and outputs the first feature sequence of the source domain and the first feature sequence of the target domain.

[0035] Calculate the feature distribution difference between the first feature sequence of the source domain and the first feature sequence of the target domain, and perform domain-to-domain feature matching by dynamically adjusting the matching weight based on the calculated feature distribution difference;

[0036] The matched feature data is input into the decoder part of the domain adaptive transfer learning model. The decoder uses the masked multi-head attention mechanism module, the multi-head attention mechanism module and the feed-forward network to generate the prediction sequence.

[0037] Obtain the ship's roll prediction value based on the generated prediction sequence

[0038] Furthermore, the feature distribution difference between the first feature sequence of the source domain and the first feature sequence of the target domain is calculated by the following formula:

[0039]

[0040] in, is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a The difference measure of the feature distribution at the cth time step and the nth iteration, is the feature difference weight at the lth time point in the nth iteration, d adv (S a ,T a ) is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a The distribution shift measure of , L is the length of the sliding time window, that is, L different time points are considered in each iteration.

[0041] Furthermore, the feature matching of the domain is performed by dynamically adjusting the matching weight based on the calculated feature distribution difference, specifically including:

[0042] According to the calculated characteristic distribution difference Difference in feature distribution from the previous iteration The feature difference weight is updated by the following formula:

[0043]

[0044] in, is the updated feature difference weight, σ(·) is the Sigmoid function. I(·) is an indicator function, when I(·) is true, the value is 1, otherwise it is 0;

[0045] Based on the updated feature difference weight Feature matching is performed using the following formula:

[0046]

[0047] Get the matched feature data X en ,in is the updated feature difference weight.

[0048] Furthermore, the prediction sequence acquisition step includes:

[0049] The matched feature data X en Input the decoder part of the domain adaptive transfer learning model to generate a prediction sequence

[0050]

[0051] Among them, Decoder(X en )for:

[0052]

[0053] in, They represent the outputs of the decoder’s masked multi-head attention mechanism module MMHA, the multi-head attention mechanism module MHA, and the feedforward network FFN, respectively. MMHA(·), MHA(·), and FeedForward(·) are the masked multi-head attention mechanism operation, the multi-head attention mechanism operation, and the feedforward network operation, respectively.

[0054] The prediction sequence is passed through a linear layer It is converted into a dimension that matches the ship roll prediction task, and then passes through the softmax layer to convert the output of the linear layer into a probability distribution to obtain the ship roll prediction value

[0055]

[0056] Among them, W F3 With b F3 are the weight matrix and bias of the linear layer respectively.

[0057] Furthermore, the domain adaptive transfer learning model loss function is:

[0058] L all =argminL org +βLwfm

[0059]

[0060] Among them, L all is the total loss function of the domain adaptive transfer learning model, L org is the first loss function, L wfm is the second loss function, β is the weight hyperparameter, y i is the true value of the ship rolling of the i-th sample, is the predicted value of ship rolling of the ith sample, n is the total number of samples, S a , T a are the first feature sequence of the source domain and the first feature sequence of the target domain output by the encoder, respectively. is the feature difference weight at the lth time point, the length of the sliding window in the L domain adaptation process, and d adv (S a ,T a ) is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a A measure of the distribution shift of .

[0061] Furthermore, the transfer learning of the domain adaptive transfer learning model adopts a dynamic unfreezing strategy, which specifically includes:

[0062] The model parameters obtained by source sea condition training are used as initial values, and the optimal thawing layer L is identified through a dynamic thawing strategy. * ,In this process, the model parameters are divided into multiple layers, and the loss values ​​after thawing of each layer are compared to determine the ,optimal thawing layer;

[0063] The parameters of the optimal unfrozen layer are kept unfrozen, the parameters of other layers remain unchanged, and the model parameters are further optimized and trained.

[0064] Compared with the prior art, the present invention has the following advantages:

[0065] (1) The present invention achieves high-precision prediction of SOV roll motion under different sea conditions by introducing domain adaptive transfer learning technology, which can effectively solve the problem that traditional methods cannot accurately model and predict SOV roll motion in complex sea conditions. Especially when the wave frequency and wave angle change drastically, the present invention can improve the accuracy of roll motion prediction and ensure that the operating vessel can maintain good operating performance under different sea conditions.

[0066] (2) The present invention optimizes the transfer learning process of the model through a dynamic thawing strategy, and can gradually adjust the number of thawing layers, so that in the process of transfer learning, it can flexibly respond to changes in different sea conditions. This strategy not only ensures the feature matching between the source domain and the target domain, but also enables the model to maintain high stability and adaptability in a changing marine environment, thereby improving the robustness of the prediction.

[0067] (3) The present invention uses the time similarity quantitative division technology to accurately divide the ship motion data within a time period into the source domain and the target domain, eliminating the differences in motion amplitude and period caused by time changes, so that the model can better capture the law of rolling motion changing over time, thereby improving the prediction accuracy.

[0068] (4) The present invention calculates the distribution offset through an adversarial training algorithm, which can achieve feature matching between the source domain and the target domain, thereby eliminating the performance differences of the rolling motion under different sea conditions and improving the adaptability and stability of the model under complex sea conditions.

[0069] (5) The present invention uses the encoder and decoder structure of the domain adaptive transfer learning model, combined with the multi-head attention mechanism, feedforward network and masked multi-head attention mechanism module, to effectively extract time series features and perform feature matching, ensuring the smooth conversion and accurate prediction of the ship's rolling motion data between different time periods, further improving the prediction accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 is a flow chart of the method of the present invention;

[0071] Figure 2 Schematic diagram of the wave direction angle of the present invention. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 should fall within the scope of protection of the present invention.

[0073] Embodiment 1:

[0074] Figure 1 A method for predicting and compensating ship motion based on domain adaptive transfer learning in an embodiment of the present invention is exemplarily shown, comprising the following steps:

[0075] The ship motion data is collected in real time by sensors, wherein the ship motion data includes the ship rolling angle at each time point;

[0076] The ship motion data is quantitatively divided based on time similarity, and the ship motion data is divided into source domain motion data and target domain motion data;

[0077] The source domain motion data and the target domain motion data are input into the pre-trained domain adaptive transfer learning model for processing, and the predicted ship rolling motion data at the future moment is output;

[0078] Perform kinematic inverse analysis on the collected ship motion data and the predicted ship roll motion data to obtain the extension and retraction amounts of the corresponding sampling points of the six electric cylinders of the Stewart platform;

[0079] The obtained extension and contraction amounts of the corresponding sampling points of the six electric cylinders of the Stewart platform are fed back to the ship control system to adjust the ship movement in real time.

[0080] The ship rolling angle at each time point is:

[0081]

[0082] Among them, φ(ω,α) is the roll angle of the ship, ω is the angular frequency, α is the wave direction angle, F(ω) is the force of the wave, d is the arm of the ship's roll rotation, I is the ship's moment of inertia, B is the roll damping coefficient, σ is the imaginary unit, and C is the ship's restoring moment coefficient.

[0083] The ship motion data is quantitatively divided according to time similarity, which specifically includes the following steps:

[0084] Given any T time points t1≤…≤t T , in [0,t1],··[t T-1 t T ], the rolling motion observed in each time period is defined as the unit area D1, D2…D T It is expressed as:

[0085]

[0086] in, is the ship rolling motion data at the i-th time point in time period l, is the predicted value of the ship's rolling motion at the i-th time point in time period l, N l is the number of time points in time period l, X l , Y l They represent the ship rolling motion data space and predicted value space in time period l respectively;

[0087] According to the obtained unit domains D1, D2...D T , select the time period [t1t2…t T-1 Any time point t inj (j∈{1,2,…,T-1}), merge the first j unit domains into the source domain D s =[D1,D2,…,D j ], and then Tj unit domains are merged into the target domain D t =[D j+1 ,D j+2 ,…,D T ];

[0088] For each pair of source domains D s and target area D t , calculate its distribution offset, the distribution offset of each domain pair can be expressed as:

[0089] L dm (D s ,D t ) = d adv (X s ,X t )

[0090] Among them, X s , X t Represents the source domain D s and target area D t The ship rolling motion data space in the distribution offset metric d(X s ,X t ) is calculated using the adversarial training algorithm, and the calculation formula is:

[0091] d adv (X s ,X t )=-E([log[G(X s )]]+[log[1-G(X t )]])

[0092] Among them, E(·) represents the expected value of the distribution function, and G(·) is a discriminant network used to determine whether the data belongs to the source domain data;

[0093] Through the time similarity quantization algorithm, find the pair of source domain motion data D with the largest distribution offset among the domain pairs of T-1 combinations. s and the target domain motion data D t , and its calculation process is described by the following formula:

[0094]

[0095] The domain adaptive transfer learning model includes: a single-layer decoder and encoder structure, wherein the encoder includes a multi-head attention mechanism module, a feedforward network and a domain adaptive module, and the decoder includes a masked multi-head attention mechanism module, a multi-head attention mechanism module and a feedforward network.

[0096] The source domain motion data and the target domain motion data are input into the domain adaptive transfer learning model for processing. The processing process includes:

[0097] Position encoding is performed on the source domain motion data and the target domain motion data to obtain the roll motion data integrated with the time information;

[0098] The position-encoded source and target domain data are input into the encoder for feature extraction. The encoder extracts the temporal features of the source and target domains through a multi-head attention mechanism and a feedforward neural network, and outputs the first feature sequence of the source domain and the first feature sequence of the target domain.

[0099] Calculate the feature distribution difference between the first feature sequence of the source domain and the first feature sequence of the target domain, and perform domain-to-domain feature matching by dynamically adjusting the matching weight based on the calculated feature distribution difference;

[0100] The matched feature data is input into the decoder part of the domain adaptive transfer learning model. The decoder uses the masked multi-head attention mechanism module, the multi-head attention mechanism module and the feed-forward network to generate the prediction sequence.

[0101] Obtain the ship's roll prediction value based on the generated prediction sequence

[0102] Calculate the feature distribution difference between the first feature sequence of the source domain and the first feature sequence of the target domain. The calculation formula is:

[0103]

[0104] in, is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a The difference measure of the feature distribution at the cth time step and the nth iteration, is the feature difference weight at the lth time point in the nth iteration, d adv (S a ,T a ) is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a The distribution shift measure of , L is the length of the sliding time window, that is, L different time points are considered in each iteration.

[0105] Based on the calculated feature distribution differences, domain-to-feature matching is performed by dynamically adjusting the matching weights, including:

[0106] According to the calculated characteristic distribution difference Difference in feature distribution from the previous iteration The feature difference weight is updated by the following formula:

[0107]

[0108] in, is the updated feature difference weight, σ(·) is the Sigmoid function. I(·) is an indicator function, when I(·) is true, the value is 1, otherwise it is 0;

[0109] Based on the updated feature difference weight Feature matching is performed using the following formula:

[0110]

[0111] Get the matched feature data X en ,in is the updated feature difference weight.

[0112] The steps of obtaining the prediction sequence include:

[0113] The matched feature data X en Input the decoder part of the domain adaptive transfer learning model to generate a prediction sequence

[0114]

[0115] Among them, Decoder(X en )for:

[0116]

[0117] in, They represent the outputs of the decoder’s masked multi-head attention mechanism module MMHA, the multi-head attention mechanism module MHA, and the feedforward network FFN, respectively. MMHA(·), MHA(·), and FeedForward(·) are the masked multi-head attention mechanism operation, the multi-head attention mechanism operation, and the feedforward network operation, respectively.

[0118] The prediction sequence is passed through a linear layer It is converted into a dimension that matches the ship roll prediction task, and then passes through the softmax layer to convert the output of the linear layer into a probability distribution to obtain the ship roll prediction value

[0119]

[0120] Among them, W F3 With b F3 are the weight matrix and bias of the linear layer respectively.

[0121] The domain adaptive transfer learning model loss function is:

[0122] L all =argminL org +βL wfm

[0123]

[0124] Among them, L all is the total loss function of the domain adaptive transfer learning model, L org is the first loss function, L wfm is the second loss function, β is the weight hyperparameter, y i is the true value of the ship rolling of the i-th sample, is the predicted value of ship rolling of the ith sample, n is the total number of samples, S a , T a are the first feature sequence of the source domain and the first feature sequence of the target domain output by the encoder, respectively. is the feature difference weight at the lth time point, the length of the sliding window in the L domain adaptation process, and d adv (S a ,T a ) is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a A measure of the distribution shift of .

[0125] The transfer learning of the domain adaptive transfer learning model adopts a dynamic thawing strategy, which includes:

[0126] The model parameters obtained by source sea condition training are used as initial values, and the optimal thawing layer L is identified through a dynamic thawing strategy. * ,In this process, the model parameters are divided into multiple layers, and the loss values ​​after thawing of each layer are compared to determine the ,optimal thawing layer;

[0127] Keep the parameters of this layer unfrozen, the parameters of other layers remain unchanged, and further optimize and train the model parameters.

[0128] Embodiment 2:

[0129] The parts not mentioned in this embodiment are the same as those in Embodiment 1.

[0130] The force exerted by waves on ships or marine structures can be calculated using the wave spectrum. Specifically, the wave force F(t) can be obtained by multiplying the wave spectrum with the response function of the ship or structure and integrating all relevant frequencies:

[0131]

[0132] In formula (1), S(f) represents the wave energy density at frequency f, ω=2πf is the angular frequency, j is the imaginary unit, and t is the time. R(f) is the RAO (Response Amplitude Operator) response function, which is used to describe the response characteristics of a ship or floating body under specific sea conditions, and usually has the following form:

[0133]

[0134] In formula (2), Φ(f) is the motion response amplitude of the ship under specific wave conditions. M(f) is the amplitude of the wave excitation.

[0135] The wave force F acts on the side of the hull, generating a wave excitation torque M. This torque depends on the direction and size of the wave and the interaction between the wave and the hull, and can be approximately described by the expression of the wave excitation torque:

[0136] M=F·d (3)

[0137] In formula (3), d is the moment arm, that is, the distance from the wave force point to the longitudinal axis of the ship. For rolling motion, the moment arm is usually half the width of the ship. Therefore, the rolling motion of the ship can usually be described by the following formula:

[0138]

[0139] In formula (4), I is the moment of inertia of the ship, Φ is the roll angle of the ship, B is the roll damping coefficient, and C is the restoring moment coefficient (related to the stability of the ship).

[0140] The relationship between the roll angle and the wave angle can be understood by considering the effect of the wave excitation moment on the ship's rolling motion.

[0141] ω 2 IΦ(ω)+jωBΦ(ω)+CΦ(ω)=M(ω) (5)

[0142] In formula (5), ω is the angular frequency, Φ(ω) is the Fourier transform of the roll angle, and M(ω) is the Fourier transform of the wave excitation torque. From formula (3), the roll response function R(ω) is expressed as:

[0143]

[0144] The wave excitation moment M is actually significantly affected by the wave direction. Considering the wave angle α, the expression of the wave excitation moment can be adjusted to:

[0145] M(α)=F·d·sin(α) (7)

[0146] In this adjusted expression, the term sin(α) is used to describe the effect of wave direction on the excitation torque. Figure 2 As shown:

[0147] Ship roll response Considering the change of wave excitation moment M(α), the ship's roll angle response Φ(ω,α) can be expressed as:

[0148]

[0149] The SOV-RM is periodically oscillated around the x-axis by the ship in wind and waves, which has a significant impact on the safety and operating efficiency of personnel and equipment during the installation of wind turbines. Therefore, accurate prediction of SOV-RM is of great significance to improving roll compensation, ensuring safety, and extending the construction window. Figure 2 As shown, following waves, top waves and cross waves are represented by wave direction angles of 0°, 180° and 90° respectively. Combined with formula (8), it can be seen that when the wave frequency is constant, it can be seen from sin(α) that different wave direction angles have a significant impact on SOV-RM: as the wave direction angle increases from 0° (following waves) to 90° (cross waves), the horizontal force and rolling moment generated by the waves gradually increase. However, as the wave direction angle increases from 90° to 180° (top waves), these forces and moments gradually decrease. It can be seen that when sin(α) = 1, the direct excitation moment of the wave on the SOV-RM is the largest. This is because the forces and moments exerted by the waves on one side of the SOV are most effective in inducing the SOV-RM. Therefore, this embodiment studies the worst case, which also increases the difficulty of prediction.

[0150] Wave frequency has a strong interference on SOV-RM and has a significant impact on its heterogeneity. There is a peak in the wave spectrum of each sea condition, and the peak frequency is recorded as ω p (1) As the wave level increases, the peak value of the wave spectrum function also increases accordingly, resulting in more intense wave changes and greater wave heights. (2) ω<ω p When ω>ω, the power spectrum density S(ω) increases with the increase of ω; p When ω increases, the power spectrum density S(ω) decreases. (3) As the wave level increases, the power spectrum density S(ω) decreases. pIt gradually decreases, indicating that the long-wave component in the wave spectrum increases. Under the same sea condition, frequency fluctuations within a certain range will cause the distribution of SOV-RM to change over time, resulting in heterogeneity within the sequence. Under different sea conditions, due to the different peak frequencies of SOV-RM, the distribution differences between sequences are large, resulting in heterogeneity between sequences. The wave frequency has a strong interference on the ship's rolling motion and also significantly affects its heterogeneity. Under the same sea condition, due to the fluctuation of frequency within the range, the distribution of the rolling motion will shift over time, resulting in heterogeneity within the sequence. The rolling motion under different sea conditions, due to the different peak frequencies, makes the distribution differences between sequences greater, which in turn leads to heterogeneity between sequences.

[0151] The intra-sequence heterogeneity of SOV-RM is manifested as a distribution shift within the same sequence, and the inter-sequence heterogeneity is manifested as a distribution shift between multiple sequences. Therefore, this embodiment uses the TSQ algorithm to calculate the distribution shift. When training the model, any T time points t1≤…≤t T , in [0,t1],…[t T-1 t T ], the rolling motion observed in each period is defined as the unit area D1, D2…D T It is expressed as:

[0152]

[0153] In formula (9), N l Corresponding to the rolling motion at time point l and its predicted value and sample size, X l ,Y l Represents the roll motion at time point l and its predicted value space.

[0154] For a given T unit domain D1~D T , set j to [t1t2…t T-1 ] at any time point. These fields are divided into two parts from the jth point, and the first part of the j-unit field is added up to [D1,…,D j ] as the source field D s , the remaining part [D j+l ,…,D T ] is the target domain D t There are T-1 combinations of domain pairs, and the distribution shift of each domain pair can be expressed as:

[0155] L dm (D s ,D t )=d(X s ,X t ) (10)

[0156] In formula (10), Xs and X t Respectively represent D s and D t Data samples. Use the (Adversarial, Adv) adversarial algorithm to calculate d(X s ,X t ). Its expression is as follows:

[0157] d adv (X s ,X t )=-E([log[D(X s )]]+[log[1-D(X t )]]) (11)

[0158] In formula (11), E(·) represents the expected value of the distribution function, and D(·) is a discriminant network that determines whether the data is "source domain data". If its input is X s or X with similar distribution t , the closer the probability of the output being the source domain data is to 1, the distribution shift between the two domains can be quantified according to formula (11).

[0159] According to the maximum information principle, the shared knowledge contained in the time series under temporal covariate drift can be maximized by finding the periods that are most dissimilar to each other, which is also considered to be the worst case of temporal covariate drift because the distribution across periods is the most diverse.

[0160] Using the TSQ algorithm, find the pair with the largest distribution deviation among the T-1 domain pair combinations. The calculation process can be described by formula (12).

[0161]

[0162] Based on the maximum entropy principle, the domain pairs of heterogeneous SOV-RM within the sequence are divided to achieve feature matching of the model. The heterogeneous SOV-RM between sequences essentially belong to different sequences and are not affected by domain division, but the distribution shift can be measured using the maximum entropy method.

[0163] Since SOV-RM is small in sea conditions 1 and 2, the impact on construction is small, while the destructiveness of waves above sea conditions 6 is very large and not suitable for research. This embodiment studies SOV-RM with a wave direction angle of 90° in sea conditions 3 to 6, realizes effective roll reduction control, and accurately predicts the motion posture of the ship in severe sea conditions.

[0164] In actual sea areas, the rolling motion of ships is affected by a variety of random factors such as wind, waves, and surges, and these factors themselves also have the characteristics of time variation. This characteristic causes the distribution of rolling motion to shift over time, resulting in heterogeneity within the sequence. The heterogeneity between rolling motion sequences originates from the different frequencies of the wave spectrum. Therefore, this embodiment proposes a prediction method combining the AdaTF model with transfer learning (AdaTF-TL), which can effectively solve the heterogeneity of ship motion and improve prediction accuracy. The first module is called Temporary Similarity Quantification (TSQ), which aims to better characterize the distribution information in the time series. The second module is called Dynamic Weighted Distance (DWD), which aims to reduce the distribution mismatch in the time series to learn the Transformer-based adaptive time series prediction model. The third module is called Dynamic Unfreezing Strategy (DUS), which aims to migrate the trained model to other working conditions to improve the generalization of the prediction model.

[0165] AdaTF is an effective neural network that matches feature distribution and is mainly composed of two parts: an encoder and a decoder. It mainly relies on the Multi-Head Attention (MHA) mechanism submodule for nonlinear learning of time series data. In addition, its domain adaptation module uses DWD as a regularizer to match the distribution of each domain pair, which can effectively alleviate the challenges caused by distribution shift in time series prediction. Therefore, this embodiment selects the AdaTF model as the source model and applies DWD to the final output of the model encoder.

[0166] Given the roll motion data Yes X s The roll motion prediction learns a function F using the observed c time step history to predict the data for the next q time stamps.

[0167]

[0168] where θ is the learnable prediction model parameter, is the predicted value at timestamp j. First, the roll motion data needs to be integrated with embedded coding and position coding to capture the position information in the sequence. The calculation formula is as follows:

[0169]

[0170] in is the historical data of c timestamps. Represent the trainable weights and biases, respectively, contained in the model parameters θ = [W0, b0; W1, b1; ..., W L ,b L ], where L represents the number of layers of the model. is the position index in the sequence. is a column matrix whose values ​​are all 1. is the final encoded representation containing position information. The encoder adopts a single-layer structure, and the output is defined as Encoder( ) operates as follows:

[0171]

[0172] in Represent the output of the MHA mechanism and the feedforward network respectively.

[0173] The MHA mechanism can capture multiple features in the sequence and the importance of different time points, and enhance the model's ability to integrate information. Perform a linear transformation, With a set of weight matrices Multiply to get the matrix (Query), (key value), (value), which enables the model to dynamically focus on the most relevant part of the input data. The formula is as follows:

[0174]

[0175] Each head is represented by its own weight matrix W i Q , W i K , W i V Q, K, and V are linearly transformed so that each head can capture different features of the input data. Finally, they are concatenated horizontally to form a single vector. The merged vector is then linearly transformed To combine these headers to get the output of MHA(·):

[0176] MHA(Q,K,W)=Concat(head1,…,head h )W O (20)

[0177] head i =Attention(QW i Q ,KW i K ,VWi V ) (twenty one)

[0178] In formula (20), h is the total number of heads, d k is a scaling factor used to prevent the dot product from being too large. The model can learn from multiple perspectives in parallel and improve the recognition of sequence data features with the help of MHA. MHA outputs an integrated vector containing multiple representation subspace information.

[0179] The feedforward neural network processes information through two linear layers and adds an activation function to increase the nonlinear processing capability of the model. FFH(·) is expressed as:

[0180]

[0181] and are the weights of the fully connected feed-forward network.

[0182] At this point, the information output of the sequence is successfully obtained, and the high-dimensional feature extraction of the domain pair is completed. This embodiment uses the DWD algorithm to match the distribution of high-dimensional features of the domain pair. Given a domain pair, the feature distribution difference between the source domain and the target domain is calculated in combination with formula (23):

[0183]

[0184] In formula (23), Represent the high-dimensional feature maps of domain pairs respectively. Represents the weight of the high-dimensional feature difference of the domain pair at time point l. Due to the sliding of the time window, the high-dimensional feature map at the current time point l contains features of c different time steps. For each time step c, the feature difference of its domain pair is calculated separately, and the one with large feature difference is given a larger weight to expand its effect of reducing distribution difference, so as to give it more attention to strengthen training, and finally calculate the weighted sum of the differences.

[0185] In order to make the model more sensitive to differences in different time steps, especially those significant differences, this embodiment uses formula (24) to update the weights

[0186]

[0187] In formula (24), σ(·) is the Sigmoid function. I(condition) is an indicator function. When I(condition) is true, its value is 1, otherwise it is 0. That is, when the feature difference of the nth iteration of a certain time step is greater than the feature difference of the n-1th iteration, the value of the weight of the n+1th iteration is increased. Otherwise, the weight remains unchanged.

[0188] The matched feature data X en Input the decoder part of the domain adaptive transfer learning model to generate a prediction sequence

[0189]

[0190] Among them, Decoder(X en )for:

[0191]

[0192] in, They represent the outputs of the decoder’s masked multi-head attention mechanism module MMHA, the multi-head attention mechanism module MHA, and the feedforward network FFN, respectively. MMHA(·), MHA(·), and FeedForward(·) are the masked multi-head attention mechanism operation, the multi-head attention mechanism operation, and the feedforward network operation, respectively.

[0193] The prediction sequence is passed through a linear layer It is converted into a dimension that matches the ship roll prediction task, and then passes through the softmax layer to convert the output of the linear layer into a probability distribution to obtain the ship roll prediction value

[0194]

[0195] Among them, W F3 With b F3 are the weight matrix and bias of the linear layer respectively.

[0196] The difference between the decoder and the encoder is that the Masked Multi-Head Attention (MMHA) mechanism contained in the decoder uses masking technology to maintain the autoregressive characteristics of information, ensuring that when predicting the output of the current position, the model can only access the information before the current position, but not the information after. The formula is as follows:

[0197] MMHA(Q,K,V)=softmax(α+M)V (25)

[0198] In formula (25), α is obtained from formula (17), is the masking matrix, which has the same size as the K matrix and is expressed as:

[0199]

[0200] In formula (26), i and j are the row index and column index of the matrix respectively. The mask sets the elements above the diagonal to extremely large negative numbers and the elements on and below the diagonal to zero. This setting ensures that the attention scores of future positions are close to zero before the softmax function is applied, thereby ensuring that the decoder only uses current and previous information when generating outputs. The sequence output by the decoder passes through a linear layer to convert the output to a dimension that matches the final task, and then passes through a softmax layer to convert the output of the linear layer into a probability distribution to obtain the final predicted value. The optimal parameters θ* of the model and the weights w* of the feature differences are learned by minimizing the model training loss and the feature difference loss. Combined with formula (23), it is specifically:

[0201]

[0202] In formula (27), β is a weight hyperparameter used to balance the importance of the two loss terms. org Training loss for the model:

[0203]

[0204] In formula (28), y i is the true value, is the predicted value and n is the number of samples.

[0205] As part of transfer learning, this embodiment proposes a dynamic unfreezing strategy based on the model-based transfer learning method. This strategy allows the model to optimize specific layers or parameters to adapt to the target task while maintaining the pre-trained weights. This method is particularly suitable for situations where the target task data is limited or the training cost is high. It can effectively utilize the knowledge learned in the source task and quickly adjust it for the new task.

[0206] In the rolling motion, the sea conditions under different frequencies, wave heights, and wave spectra are different. The model trained in the source sea conditions has parameters θ sou This model can be used to predict the output y of the source sea state sou , given an input x sou , after the nonlinear mapping function f(·) of the model, we get:

[0207] y sou =f(x sou θ sou ) (29)

[0208] In the process of transfer learning, we hope to find a set of parameters θ tar , so that in the target sea state, the model's prediction y tar As close to the real output as possible

[0209]

[0210] In order to realize the migration of the model, some model parameters θ of the source sea state can be shared by s Migrate to the target sea state, that is, let θ tar Initially equal to θ sou .

[0211] In this embodiment, the DUS algorithm is used to clearly illustrate the migration of model parameters. The parameter set of the model is defined as θ, where θ1, θ2, …, θ L , respectively represent the parameters of the model from the first layer to the last layer. The goal is to identify the optimal unfreezing layer L * , so that the loss value obtained after unfreezing and training this layer is minimized. Loss function L l Used to evaluate the performance of the model after each layer is unfrozen, defined as:

[0212]

[0213] By comparing the loss values ​​of each layer after thawing, the optimal thawing layer L can be determined * :

[0214]

[0215] Finally, keep L * The parameters of the layer are unfrozen, while the parameters of other layers are re-frozen, and then further optimized and trained in combination with formula (27) to maintain the stability of the model:

[0216]

[0217] In this configuration, Indicates L * The parameters of the layer are updated after training again, while the parameters of other layers remain unchanged. This approach allows the model to focus on optimizing the part that has the greatest impact on performance while retaining the effective feature representation of other layers.

[0218] This strategy can find the model structure that best suits the target domain, thereby improving the generalization ability of the model in the target domain. Then, θ can be further adjusted by optimizing the loss function of the target domain. tar , so that the model performs better in the target domain. Moreover, for the parameters of each layer, the learning rate can be adjusted according to the loss value of the target domain to better adapt to the data distribution of the target domain. This method can effectively improve the generalization ability of the model, thereby improving the prediction accuracy of the ship's rolling motion.

[0219] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0220] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A ship motion prediction and compensation method based on domain adaptive transfer learning, characterized in that: The following steps are involved: The ship motion data is collected in real time by sensors, wherein the ship motion data includes the ship rolling angle at each time point; The ship motion data is quantitatively divided based on time similarity, and the ship motion data is divided into source domain motion data and target domain motion data; The source domain motion data and the target domain motion data are input into the pre-trained domain adaptive transfer learning model for processing, and the predicted ship rolling motion data at the future moment is output; Perform kinematic inverse analysis on the collected ship motion data and the predicted ship roll motion data to obtain the extension and retraction amounts of the corresponding sampling points of the six electric cylinders of the Stewart platform; The obtained extension and contraction amounts of the corresponding sampling points of the six electric cylinders of the Stewart platform are fed back to the ship control system to adjust the ship movement in real time.

2. A method for predicting and compensating ship motion based on domain adaptive transfer learning according to claim 1, characterized in that: The ship rolling angle at each time point is: Wherein, φ(ω, α) is the roll angle of the ship, ω is the angular frequency, α is the wave direction angle, F(ω) is the force of the wave, d is the arm of the ship's roll rotation, I is the ship's moment of inertia, B is the roll damping coefficient, σ is the imaginary unit, and C is the ship's restoring moment coefficient.

3. A ship motion prediction and compensation method based on domain adaptive transfer learning according to claim 1, characterized in that: The quantitative division of time similarity of the ship motion data specifically includes the following steps: Given any T time points t1≤…≤t T , in [0, t1], .. [t T-1 t T ], the rolling motion observed in each time period is defined as the unit area D1, D2…D T It is expressed as: in, is the ship rolling motion data at the i-th time point in time period l, is the predicted value of the ship's rolling motion at the i-th time point in time period l, N l is the number of time points in time period l, X l , Y l They represent the ship rolling motion data space and predicted value space in time period l respectively; According to the obtained unit domains D1, D2...D T , select the time period [t1t2…t T-1 Any time point t in j (j∈(1, 2, ..., T-1}), merge the first j unit domains into the source domain D s =[D1, D2, ..., D j ], and then Tj unit domains are merged into the target domain D t =[D j+1 , D j+2 , …, D T ]; For each pair of source domains D s and target area D t , calculate its distribution offset, the distribution offset of each domain pair can be expressed as: L dm (D s ,D t )=d ddv (X s ,X t ) Among them, X s , X t Represents the source domain D s and target area D t The ship rolling motion data space in the distribution offset metric d(X s , X t ) is calculated using the adversarial training algorithm, and the calculation formula is: d adv (X s ,X t )=-E([log[G(X s )]]+[log[1-G(X t )]]) Among them, E(·) represents the expected value of the distribution function, and G(·) is a discriminant network used to determine whether the data belongs to the source domain data; Through the time similarity quantization algorithm, find the pair of source domain motion data D with the largest distribution offset among the domain pairs of T-1 combinations. s and the target domain motion data D t , and its calculation process is described by the following formula:

4. A method for predicting and compensating ship motion based on domain adaptive transfer learning according to claim 1, characterized in that: The domain adaptive transfer learning model includes: a single-layer decoder and encoder structure, wherein the encoder includes a multi-head attention mechanism module, a feedforward network and a domain adaptive module, and the decoder includes a masked multi-head attention mechanism module, a multi-head attention mechanism module and a feedforward network.

5. A method for predicting and compensating ship motion based on domain adaptive transfer learning according to claim 1, characterized in that: The source domain motion data and the target domain motion data are input into the domain adaptive transfer learning model for processing, and the processing process includes: Position encoding is performed on the source domain motion data and the target domain motion data to obtain the roll motion data integrated with the time information; The position-encoded source and target domain data are input into the encoder for feature extraction. The encoder extracts the temporal features of the source and target domains through a multi-head attention mechanism and a feedforward neural network, and outputs the first feature sequence of the source domain and the first feature sequence of the target domain. Calculate the feature distribution difference between the first feature sequence of the source domain and the first feature sequence of the target domain, and perform domain-to-domain feature matching by dynamically adjusting the matching weight based on the calculated feature distribution difference; The matched feature data is input into the decoder part of the domain adaptive transfer learning model. The decoder uses the masked multi-head attention mechanism module, the multi-head attention mechanism module and the feed-forward network to generate the prediction sequence. Obtain the ship's roll prediction value based on the generated prediction sequence 6. A method for predicting and compensating ship motion based on domain adaptive transfer learning according to claim 5, characterized in that: The calculation formula for calculating the feature distribution difference between the first feature sequence of the source domain and the first feature sequence of the target domain is: in, is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a The difference measure of the feature distribution at the cth time step and the nth iteration, is the feature difference weight at the lth time point in the nth iteration, d adv (S a , T a ) is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a The distribution shift measure of , L is the length of the sliding time window, that is, L different time points are considered in each iteration.

7. A method for predicting and compensating ship motion based on domain adaptive transfer learning according to claim 5 or 6, characterized in that: The domain-to-feature matching is performed by dynamically adjusting the matching weight based on the calculated feature distribution difference, specifically including: According to the calculated characteristic distribution difference Difference in feature distribution from the previous iteration The feature difference weight is updated by the following formula: in, is the updated feature difference weight, σ(·) is the Sigmoid function, I(·) is an indicator function, when I(·) is true, the value is 1, otherwise it is 0; Based on the updated feature difference weight Feature matching is performed using the following formula: Get the matched feature data X en ,in is the updated feature difference weight.

8. The method for predicting and compensating ship motion based on domain adaptive transfer learning according to claim 5, characterized in that: The prediction sequence acquisition step comprises: The matched feature data X en Input the decoder part of the domain adaptive transfer learning model to generate a prediction sequence Among them, Decoder(X en )for: in, They represent the outputs of the decoder’s masked multi-head attention mechanism module MMHA, the multi-head attention mechanism module MHA, and the feedforward network FFN, respectively. MMHA(·), MHA(·), and FeedForward(·) are the masked multi-head attention mechanism operation, the multi-head attention mechanism operation, and the feedforward network operation, respectively. The prediction sequence is passed through a linear layer It is converted into a dimension that matches the ship roll prediction task, and then passes through the softmax layer to convert the output of the linear layer into a probability distribution to obtain the ship roll prediction value Among them, W F3 With b F3 are the weight matrix and bias of the linear layer respectively.

9. The method for predicting and compensating ship motion based on domain adaptive transfer learning according to claim 1, characterized in that: The domain adaptive transfer learning model loss function is: L all =argminL org +βL wfm Among them, L all is the total loss function of the domain adaptive transfer learning model, L org is the first loss function, L wfm is the second loss function, β is the weight hyperparameter, y i is the true value of the ship rolling of the i-th sample, is the predicted value of ship rolling of the ith sample, n is the total number of samples, S a 、T a are the first feature sequence of the source domain and the first feature sequence of the target domain output by the encoder, respectively. is the feature difference weight at the,th time point, the length of the sliding window in the L domain adaptation process, d adv (S a , T a ) is the first feature sequence S in the source domain a and the first feature sequence T of the target domain a A measure of the distribution shift of .

10. The method for predicting and compensating ship motion based on domain adaptive transfer learning according to claim 1, characterized in that: The transfer learning of the domain adaptive transfer learning model adopts a dynamic unfreezing strategy, which specifically includes: The model parameters obtained by source sea condition training are used as initial values, and the optimal thawing layer L is identified through a dynamic thawing strategy. * ,In this process, the model parameters are divided into multiple layers, and the loss values ​​after thawing of each layer are compared to determine the ,optimal thawing layer; The parameters of the optimal unfrozen layer are kept unfrozen, the parameters of other layers remain unchanged, and the model parameters are further optimized and trained.

Citation Information

Cited By

  • Ocean wave compensation method and system for ship stabilization

    CN120573225A

  • Ship wharf berthing oscillation suppression control system

    CN121069799A

  • Fishing boat operation type identification and supervision method fusing multi-source positioning and behavior characteristics

    CN121456615A