Sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy

Through PSO-ShipMotionNet and spectrum-guided optimization strategies, the limitations of traditional sea state prediction technology and the interpretability problem of neural networks are solved, more accurate and stable ocean state predictions are achieved, and the physical interpretability of the model is enhanced.

CN120430530BActive Publication Date: 2025-09-05DALIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510934369.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-09-05
Estimated Expiration
2045-07-08

AI Technical Summary

Technical Problem

Traditional sea state prediction technology has deployment and usage limitations, and neural networks lack interpretability in ocean state prediction, rely on a large number of training samples, and lack prediction accuracy and stability.

Method used

The PSO-ShipMotionNet and spectrum-guided optimization strategy are adopted. The model parameters are optimized through in-sample MaxAbs normalization, Jonswap spectrum-guided Goda improved loss function, piecewise hybrid loss optimizer and particle swarm optimization (PSO). Combined with the ship response feature cross attention mechanism (SRFCA), a ResCNN benchmark network is constructed to simulate wave-ship motion response and construct a dataset.

Benefits of technology

It reduces the model's dependence on the number of training samples, improves prediction accuracy and stability, enhances the physical interpretability of the neural network, and provides a more reliable sea condition prediction solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120430530B_ABST
    Figure CN120430530B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of sea state prediction, and specifically discloses a sea state prediction method based on PSO-ShipMotionNet and a spectrum-guided optimization strategy, including first normalizing within a single sample; constructing a loss function using the modified Goda method of the Jonswap spectrum, with MAE as the energy-related loss; using a segmented hybrid loss optimizer to optimize the area and the shape of a specific frequency band respectively; using a PSO algorithm to optimize model training parameters; introducing an SRFCA mechanism to handle the nonlinear effects of ship motion coupling and a complex external environment; introducing SRFCA based on ResCNN and combining it with the PSO algorithm to construct a PSO-ShipMotionNet network; using the boundary element method to construct a data set training model; and analyzing the effects of SRFCA and segmented optimization strategies on model performance. The present invention adopts the above-mentioned sea state prediction method based on PSO-ShipMotionNet and a spectrum-guided optimization strategy, which reduces the model's dependence on the number of training samples to a certain extent, improves the model's generalization ability and physical interpretability, and provides a new solution for sea state parameter prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sea state prediction, and in particular to a sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy. Background Art

[0002] Accurate prediction of ocean state parameters is of great significance to the safety of shipping, marine engineering, and offshore operations. In a complex and dynamically changing marine environment, timely and accurate predictions can help ships optimize their speed and course under adverse conditions, reduce the risk of excessive hull damage, improve energy efficiency, and ensure the safety and economic benefits of marine ranches. Parameters such as significant wave height, spectral peak frequency, and directional expansion factor are usually used as sea state parameters. Traditional technologies for obtaining sea state parameters include manual observation, wave buoys, meteorological remote sensing satellites, and X-band radars. These traditional methods have various limitations in deployment and use, such as strong subjectivity, weak wind resistance, single deployment method, susceptibility to weather, delays, and high costs, which limit their practicality in real-time applications.

[0003] The motion response of a ship in waves is often viewed as a manifestation of wave energy, reflecting, to some extent, the severity of the ocean environment. To address this issue, researchers have proposed the buoy analogy (WBA) theory, which considers ships as wave buoys with complex geometry and dynamics. Furthermore, ships are equipped with six-degree-of-freedom sensors, whose data can be used to invert wave parameters. Therefore, these ships can be considered as marine environmental measurement tools, or these sensors can be used as risk assessment systems.

[0004] With the continuous development and iteration of data-driven methods, particularly deep neural networks (DNNs), they have gradually become the mainstream of WBA. The powerful computing power of neural networks enables them to process large amounts of input data and discover underlying patterns and regularities. However, all current neural network training processes are based on numerical loss functions, adjusting network parameters by continuously optimizing the loss value. This process typically relies on the backpropagation algorithm, in which each weight in the network is adjusted based on the error to make the output more consistent with the expected value. This numerical optimization-based training method effectively relies on the so-called "black box property." That is, while the relationship between input and output can be observed, the specific internal working principles and decision-making mechanisms of the model are difficult to fully understand and explain. This "black box" nature of neural networks stems from their complex multi-layered structure and nonlinear activation functions, which focus on capturing correlations between parameters. As a result, even if the model performs well in prediction, it is difficult to understand the causal relationship between input and output features. Explaining its prediction results and reasoning process remains an urgent problem. Therefore, improving the interpretability of neural networks, especially in key areas such as ocean state prediction, has become a major issue in the field of machine learning. Summary of the Invention

[0005] The purpose of this invention is to provide a sea state prediction method based on PSO-ShipMotionNet and a spectrum-guided optimization strategy. This method addresses the numerous limitations of traditional sea state prediction techniques in deployment and use, as well as the poor interpretability caused by the "black box" nature of neural networks. This method reduces the model's dependence on the number of training samples, improves prediction accuracy, stability, and generalization, improves local prediction accuracy, and enhances the physical interpretability of neural networks, providing a new and reliable solution for sea state prediction.

[0006] To achieve the above objectives, the present invention provides a sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy, comprising the following steps:

[0007] S1, using intra-sample MaxAbs normalization, normalization is performed within a single sample;

[0008] S2, using the Goda modified form of Jonswap spectrum to construct the loss function, calculate the area integral of the true spectrum and the predicted spectrum in a specific frequency band, and use the mean absolute error (MAE) as the energy-related loss;

[0009] S3, using a segmented hybrid loss optimizer to optimize the area and specific frequency band shape respectively;

[0010] S4. Use particle swarm optimization (PSO) to optimize model training parameters.

[0011] S5. Introducing the Ship Response Feature Cross Attention (SRFCA) mechanism to handle the coupling relationship between the ship's roll, pitch, and heave motions and the nonlinear effects of the complex external environment.

[0012] S6. Using ResCNN as the baseline network, we introduce SRFCA and combine it with the PSO algorithm to perform hyperparameter optimization and build the PSO-ShipMotionNet network.

[0013] S7. Use the boundary element method to simulate the wave-ship motion response and construct a data set. The data set is randomly divided into training set, validation set and test set. The training set is used for model training under different experimental conditions, and the test set is used for sea state prediction.

[0014] S8. Based on the prediction results under time domain input and frequency domain input, analyze the impact of SRFCA and segmented optimization strategy on model performance.

[0015] Preferably, S1 is specifically:

[0016] Calculate the maximum absolute value of all values ​​within each sample, and divide all eigenvalues ​​by the maximum value to compress the values ​​within the sample to [ ] scope;

[0017] After the loss term is normalized, when searching for loss weights, the weights are initialized in the range [0, 1] to narrow the search space;

[0018] In addition, during the normalization process, a small value limit is introduced to prevent division by zero errors caused by random initialization.

[0019] Preferably, the specific process of S2 is:

[0020] The loss function is constructed using the Goda modified form of the Jonswap spectrum. The area enclosed by the energy spectrum function and the horizontal axis of the coordinate is the zero-order moment, as shown in formula (1), which represents the sum of the energy within the frequency range;

[0021] (1);

[0022] In the formula is the shape coefficient, ; is the peak shape factor; is the spectrum peak period, in seconds; is the significant wave height, in meters; is the frequency, in Hertz;

[0023] is the shape coefficient, ;

[0024] Therefore, formula (2) can be derived from formula (1), that is, there is a positive correlation between the significant wave height and the zero-order moment;

[0025] (2);

[0026] (3);

[0027] When the peak frequency is fixed and form factor γ When the significant wave height is an important indicator to measure the zero-order moment, the area integral of the real spectrum and the predicted spectrum of a specific frequency band is calculated respectively, and the mean absolute error is further calculated. MAE As energy-related losses, it is calculated as follows:

[0028] (4);

[0029] (5);

[0030] (6);

[0031] The frequency points of the spectral function are normalized within the sample, and the energy spectrum curves under different parameter combinations are unified into one scale. After normalization, the shape of the energy spectrum curve is only related to the spectrum peak frequency.

[0032] Compute the energy density difference between all frequency points as a complement to the peak difference description:

[0033] (7);

[0034] The area first moment of energy spectrum MAE is introduced as part of the shape loss;

[0035] (8);

[0036] (9).

[0037] Preferably, the specific process of S3 is:

[0038] A segmented hybrid loss optimizer is used to optimize the area and the shape of a specific frequency band. Model 1 focuses on area optimization, while another model, Model 2, is responsible for optimizing the shape of a specific frequency band.

[0039] During the model training process, the two models are pre-trained separately, and then fine-tuned using prior model knowledge to make the model take into account the overall energy distribution and shape characteristics. The specific process is as follows:

[0040] First take As an interval, different optimization methods are used in different training stages. When epoch∈[0, ]Use the common numerical loss function, that is, optimize the two models Model1 and Model2 according to formula (10):

[0041] (10);

[0042] When epoch∈[ ,End], first predict through Model1 , and calculate MAE as area loss , and then predict through Model2 , generate several control points according to the two parameters, calculate the point density, zero-order moment, first-order moment and peak frequency respectively; calculate the weighted accumulation of the above values ​​MAE as the shape loss , the two loss functions are defined as formula (11) and formula (12):

[0043] (11);

[0044] (12);

[0045] Calculate the area loss for each batch separately and shape loss , and first back-propagate the shape loss , and then back-propagate the area loss ;

[0046] Use dynamic learning rate adjustment mechanism to enhance the convergence ability of model training in the later stage by The computational graph is retained during the back propagation of to complete the parameter adjustments of two models simultaneously.

[0047] Preferably, the specific process of S4 is:

[0048] The particle swarm algorithm (PSO) is used to optimize the hyperparameters of model training, including two learning rates, five loss weights, and The specific process is as follows:

[0049] First, according to the number of parameters to be optimized , randomly initialize the particle swarm to In dimensional space:

[0050] (13);

[0051] The position of the particle represents a potential solution;

[0052] During the iteration process, the fitness calculation is performed, that is, the parameter combination corresponding to the particle position is substituted into the model training process, the final MAE is calculated, and the historical individual optimal solution of each particle is recorded. and the historical global optimal solution of the particle swarm :

[0053] (14);

[0054] (15);

[0055] The update rules for the velocity and position of the i-th particle are as follows, where the velocity update takes into account inertial motion, cognitive motion, and social motion:

[0056] (16);

[0057] (17);

[0058] (18);

[0059] in: is the current iteration number;

[0060] is the velocity of the particle;

[0061] is the inertia weight, which controls the particle’s search ability;

[0062] and The self-cognition factor and social learning factor enable particles to update their speed and position according to individual and global optimal values;

[0063] and A random number in the range [0,1] to increase search diversity.

[0064] Preferably, the specific process of S6 is:

[0065] Using ResCNN as the baseline network, we introduce SRFCA and combine it with the PSO algorithm for hyperparameter optimization to construct the PSO-ShipMotionNet network. The PSO-ShipMotionNet network receives several input data, each of which is processed by an independent feature extraction path, that is, using convolution and SRFCA modules in multiple stages:

[0066] First, each input feature is preliminarily extracted through the three convolution blocks in the first stage; then, the SRFCA module is used to dynamically extract the interaction relationship between different inputs to generate a fused feature representation; after being processed by the convolution blocks and SRFCA modules in the first stage, the features enter the convolution blocks in the second stage. At the same time, the residual connection mechanism is used to combine the output of the current stage with the features of the previous stage; then, the network enters the third stage, extracting high-order features through deeper convolution blocks, and again applying the SRFCA mechanism to fuse the features.

[0067] Preferably, in S7, a specific wave spectrum and light-type direction distribution function are used, such as formula (19):

[0068] (19);

[0069] in, is the directional expansion factor; is the main direction of the wave; is the gamma function;

[0070] The simulated ship model has specific parameters, and the sea condition sampling range includes significant wave height, crest frequency, directional expansion factor and main direction; the training set, validation set and test set are randomly divided, and the validation set is used to observe the training process.

[0071] Therefore, the present invention adopts the above-mentioned sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy, and the beneficial effects are as follows:

[0072] (1) This paper constructs the PSO-ShipMotionNet network through multiple technologies such as intra-sample MaxAbs normalization and Jonswap spectrum-combined improved loss function, reducing the model's dependence on the number of training samples and improving the robustness of the algorithm.

[0073] (2) Compared with traditional methods, the prediction accuracy and stability of the proposed method are significantly improved under time domain and frequency domain inputs, the large error is significantly reduced, the generalization ability is enhanced, and it can be effectively applied to complex sea conditions.

[0074] (3) This invention introduces the spectrum-guided optimization strategy and SRFCA mechanism to break the “black box” characteristics of neural networks, improve physical interpretability, and provide a reliable decision-making basis for shipping, marine engineering and other fields.

[0075] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1This is an overall flow chart of an embodiment of a sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention;

[0077] Figure 2 It is the Jonswap–Goda energy spectrum of an embodiment of the sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention;

[0078] Figure 3 This is an embodiment of the sea state prediction method based on PSO-ShipMotionNet and spectrum guided optimization strategy of the present invention. When and γ remain unchanged, Relationship with area;

[0079] Figure 4 The zero-order moment loss of the sea state prediction method embodiment based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention ;

[0080] Figure 5 The sea state prediction method embodiment based on PSO-ShipMotionNet and spectrum guided optimization strategy of the present invention is normalized before and Controlled energy spectrum shape;

[0081] Figure 6 The normalized sea state prediction method embodiment of the present invention based on PSO-ShipMotionNet and spectrum guided optimization strategy is and Controlled energy spectrum shape;

[0082] Figure 7 is the energy density error at each frequency point between energy spectra of an embodiment of the sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention;

[0083] Figure 8 is the first-order moment error between the energy spectra of the sea state prediction method embodiment based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention;

[0084] Figure 9 It is a pre-training optimization process of an embodiment of a sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention;

[0085] Figure 10 It is an optimization strategy of an embodiment of a sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention;

[0086] Figure 11 This is a typical two-dimensional particle swarm optimization diagram of an embodiment of the sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention;

[0087] Figure 12 This is a flow chart of a PSO method for optimizing training hyperparameters in an embodiment of a sea state prediction method based on PSO-ShipMotionNet and a spectrum-guided optimization strategy of the present invention;

[0088] Figure 13 This is the calculation process of SRFCA of the sea state prediction method embodiment based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention;

[0089] Figure 14 This is an embodiment of the sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention, taking residual neural network as an example, and the use of channel cross attention;

[0090] Figure 15 Schematic diagram of the SRFCA module of the sea state prediction method embodiment based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention, wherein the solid line represents the query and the dotted line represents the key;

[0091] Figure 16 1 is a network structure diagram of PSO-ShipMotionNet according to an embodiment of a sea state prediction method based on PSO-ShipMotionNet and a spectrum-guided optimization strategy of the present invention;

[0092] Figure 17 This is a schematic diagram of an embodiment of a sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention, using time domain and frequency domain data as a training set;

[0093] Figure 18 is a three-dimensional model of a simulated ship in an embodiment of a sea state prediction method based on PSO-ShipMotionNet and a spectrum-guided optimization strategy of the present invention;

[0094] Figure 19 The present invention is based on the PSO-ShipMotionNet and the wave spectrum guided optimization strategy of the sea state prediction method embodiment of the time domain input Scatter plot of prediction results, where (a) is the Scheme 1 working condition, (b) is the Scheme 2 working condition, (c) is the Scheme 3 working condition, and (d) is the Scheme 4 working condition;

[0095] Figure 20The present invention is based on the PSO-ShipMotionNet and the wave spectrum guided optimization strategy of the sea state prediction method embodiment of the time domain input Absolute prediction residual distribution diagram; (a) is the comparison diagram of Scheme1 and Scheme2 working conditions, (b) is the comparison diagram of Scheme1 and Scheme3 working conditions, and (c) is the comparison diagram of Scheme2, Scheme3, and Scheme4 working conditions;

[0096] Figure 21 The present invention is based on the PSO-ShipMotionNet and the wave spectrum guided optimization strategy of the sea state prediction method embodiment of the time domain input Scatter plot of prediction results; (a) is the Scheme 1 working condition, (b) is the Scheme 2 working condition, (c) is the Scheme 3 working condition, and (d) is the Scheme 4 working condition;

[0097] Figure 22 The frequency domain input of the sea state prediction method embodiment based on PSO-ShipMotionNet and spectrum guided optimization strategy of the present invention is Scatter plot of prediction results; (a) is the Scheme 1 working condition, (b) is the Scheme 2 working condition, (c) is the Scheme 3 working condition, and (d) is the Scheme 4 working condition;

[0098] Figure 23 The frequency domain input of the sea state prediction method embodiment based on PSO-ShipMotionNet and spectrum guided optimization strategy of the present invention is Scatter plot of prediction results; (a) is the Scheme 1 working condition, (b) is the Scheme 2 working condition, (c) is the Scheme 3 working condition, and (d) is the Scheme 4 working condition. DETAILED DESCRIPTION

[0099] The technical solution of the present invention is further described below with reference to the accompanying drawings and embodiments.

[0100] Unless otherwise defined, technical or scientific terms used in the present invention shall have the same meaning as commonly understood by one of ordinary skill in the art to which the present invention belongs.

[0101] This paper proposes a spectrally guided neural network recurrent optimization strategy to improve the physical interpretability of neural networks. Based on the modified Kota formula of the Jonswap spectrum, an energy spectrum learning framework is established. While exploiting the nonlinear relationship between motion response and sea conditions, the model training process is further optimized by introducing prior knowledge and empirical models. This method reduces the model's dependence on the number of training samples to a certain extent, while improving the model's generalization ability and physical interpretability, providing a new solution for predicting sea state parameters. The main contents of this invention are as follows:

[0102] 1) A neural network collaborative optimization strategy based on wave spectrum guidance is proposed, which combines wave spectrum function loss with numerical loss to cyclically optimize model parameters.

[0103] 2) Based on feature cross-attention and convolutional layers, combined with the above optimization strategies, a Convlution and Cross-Attention based Spectrum-Informed neural network (CC-SINN) was constructed.

[0104] 3) A huge database was constructed based on the boundary element method, and a large number of test sets were used to verify the proposed method.

[0105] 4) The proposed training strategy outperforms traditional training methods on both input forms.

[0106] Chen, X, et al. used the measured stress components or motion components to estimate the wave spectrum of arbitrary shapes through nonlinear programming. Nielsen (Nielsen et al., 2021) used Fourier or wavelet transform to convert the time series into the frequency domain, and predicted the sea conditions by adjusting the response transfer function and combining it with the given wave spectrum model. Zago, L, et al. (Zago et al., 2023) developed a new spectral function based on Weibull distribution to estimate the wave spectrum. According to the view of UD Nielsen (Nielsen, 2018), these methods can be called a model method that establishes a mathematical model based on professional domain knowledge and physical principles in the time domain or frequency domain (Brodtkorb and Nielsen, 2023; Chen et al., 2023; de Mello et al., 2024; Dirdal et al., 2022; Mounet et al., 2022; Ren et al., 2021; Sun et al., 2024; Takami et al., 2023) to achieve the estimation of sea conditions.

[0107] However, due to the strong nonlinearity of waves and the complex mechanisms of ship responses, modeling methods are prone to erroneous estimates. With the development of artificial intelligence technology, data-driven methods based on neural networks (Kwon et al., 2025; Mittendorf et al., 2022; Mittendorf et al., 2022) have gained widespread attention because they can extract the relationship between sea conditions and motion from massive amounts of data without having to delve into the complex mechanisms of wave motion. Nathan K. Long et al. (Long et al., 2022) used artificial neural networks to predict wave parameters from the frequency domain using the autopower spectrum of the ship's three degrees of freedom. Jonathan Procel et al. (Procel et al., 2024) used synthetic statistical data of ship responses as features and spectral parameters calculated using a spectrum segmentation method as labels to train an Extra Trees algorithm to output sea conditions. Peihua Han et al. (Han et al., 2022) and others used generative adversarial neural networks (GANNs) to estimate sea conditions. A GANN consists of two CNNs: one for estimating the wave spectrum and the second for determining whether the estimated wave spectrum is realistic. By penalizing high-order inconsistencies in the wave spectrum from the estimation network, the estimation network is forced to produce accurate and realistic results. Bulent Duz et al. (Duz et al., 2021) consider sea state estimation as a multivariate time series regression, using an artificial neural network to estimate wave characteristics, using the ship's six-degree-of-freedom time series as input instead of statistical data. Mak B, et al. (Scholcz and Mak, 2020) builds on Bulent Duz's work by using a convolutional encoder-decoder network to estimate directional wave spectra from time series of wave radar data. Kawai, T., et al. (Kawai et al., 2021) used the Ochi-Hubble spectrum to describe the encountered sea conditions and proposed a method using convolutional neural network (CNN) to estimate the sea state parameters of the Ochi-Hubble spectrum when the ship encounters the ship from the simulated data of the ocean-going 14,000TEU container ship, demonstrating the potential of virtual data in developing sea state estimation models. Kwon, D., et al (Kwon et al., 2025) proposed a parameterization method based on optimized artificial neural network (ANN) to estimate the directional wave spectrum from the motion data of a moored floating production storage and offloading (FPSO) vessel.Integrating time-history data of ship responses (including displacement, angular velocity, and acceleration) to train and optimize the ANN significantly improves the estimation accuracy of wave height, period, and main wave direction.

[0108] In summary, current sea state estimation approaches are primarily divided into two types: model-based approaches based on physical mechanisms and data-driven approaches based on artificial intelligence (AI). The latter, leveraging technologies such as neural networks, can automatically mine deep correlations between sea conditions and ship motion from massive amounts of data, offering greater adaptability and scalability. With the rapid development of AI and the effective integration of multi-source sensor data, data-driven approaches are demonstrating significant potential in terms of accuracy and robustness. Therefore, deep learning methods based on physical constraints and prior knowledge hold great promise for application in sea state prediction.

[0109] like Figure 1 As shown, the sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy of the present invention includes the following steps:

[0110] S1. The present invention uses intra-sample MaxAbs normalization when calculating the energy spectrum loss function. However, unlike traditional MaxAbs normalization, which usually calculates the maximum absolute value across the entire batch, the present invention performs normalization within a single sample, specifically:

[0111] Calculate the maximum absolute value of all values ​​within each sample and divide all eigenvalues ​​by the maximum value to compress the values ​​within the sample to [ ] range, this method can ensure that the numerical scales of different loss terms are similar, reduce the magnitude differences between the loss terms, make the optimization process more stable, and reduce the complexity of hyperparameter adjustment for subsequent parameter adjustment work.

[0112] Since the loss term is normalized and its value is already in a similar scale range, when searching for loss weights, the weights can be initialized directly in the range [0, 1], thereby narrowing the search space and improving optimization efficiency. This strategy reduces the time required for weight adjustment to a certain extent.

[0113] In addition, during the normalization process, a small value limit is introduced to prevent division by zero errors caused by random initialization, which is shown in formula (1):

[0114] (1);

[0115] in, Indicates the number of The first sample values;

[0116] Represents the first The first sample values;

[0117] For a small value, the present invention takes 1e-6.

[0118] S2. Use Goda's modified form of Jonswap spectrum to construct a loss function, calculate the area integral of the true spectrum and the predicted spectrum in a specific frequency band, and use the mean absolute error (MAE) as the energy-related loss. The specific process is as follows:

[0119] The Goda modified loss function using Jonswap spectrum has higher accuracy and adaptability, especially in describing wind waves and wave energy distribution under different sea conditions. Goda modified Jonswap spectrum has a higher accuracy and adaptability, especially in describing wind waves and wave energy distribution under different sea conditions. ) and high frequency (ω ≥ ) part is processed differently, providing more delicate adjustments, making the peak and distribution of the spectrum more accurate, especially for the high-frequency band, which is more in line with reality.

[0120] Energy spectrum function such as Figure 2 The area enclosed by the horizontal axis is the zero-order moment, as shown in formula (2), which represents the sum of energy within the frequency range;

[0121] (2);

[0122] In the formula is the shape coefficient, ; is the peak shape factor, with an average value of 3.3 in the present invention; is the spectrum peak period, in seconds; is the significant wave height, in meters; is the frequency, in Hertz;

[0123] is the shape coefficient, ;

[0124] Therefore, formula (3) can be derived from formula (2), that is, there is a positive correlation between the significant wave height and the zero-order moment. and shape factor γ, such as Figure 3 As shown in Figure 2, the significant wave height is an important indicator for measuring the zero-order moment.

[0125] (3);

[0126] (4);

[0127] When the peak frequency is fixed When the shape factor γ is used, the significant wave height is an important indicator for measuring the zero-order moment. Therefore, the present invention calculates the area integral of the real spectrum and the predicted spectrum of a specific frequency band respectively, and further calculates their mean absolute error MAE As energy-related losses, it is calculated as follows:

[0128] (5);

[0129] (6);

[0130] (7);

[0131] like Figure 4 As shown in Figure 1, when γ is fixed to a certain value, the significant wave height and the spectrum peak period simultaneously affect the shape of the energy spectrum curve. Therefore, in order to simplify the energy spectrum shape loss process, the frequency points of the spectrum function are normalized within the sample to Figure 5-Figure 6 For example, take several - The Jonswap–Goda energy spectrum curve and the normalized energy spectrum curve are drawn respectively. After sample normalization, the energy spectrum curves under different parameter combinations are unified into one scale. Figure 6 It can be seen that after normalization, the shape of the energy spectrum curve is only related to the spectrum peak frequency, and as As , the entire image moves toward the positive direction of the x-axis.

[0132] When discretizing the energy spectrum curve, the frequency at which the maximum energy density occurs must be calculated. The difference between the actual and predicted frequencies is used to describe the peak difference. Therefore, taking as many frequency points as possible is necessary to describe the true peak position.

[0133] (8).

[0134] However, due to computing power limitations, it is difficult to meet the peak coverage requirements. Figure 7 As shown, the energy density difference between all frequency points is calculated as a supplement to the peak gap description:

[0135] (9);

[0136] In addition, the area first moment of the energy spectrum also describes the energy distribution, so if Figure 8 As shown, the area first moment of energy spectrum MAE is introduced as part of the shape loss;

[0137] (10);

[0138] (11).

[0139] S3. In order to optimize the area loss and shape loss separately while affecting each other, the present invention adopts a segmented hybrid loss optimizer to optimize the area and the shape of a specific frequency band respectively. The specific process of S3 is as follows:

[0140] A segmented hybrid loss optimizer is used to optimize the area and the shape of a specific frequency band respectively. Model 1 focuses on area optimization, and the other model Model 2 is responsible for optimizing the shape of a specific frequency band.

[0141] During model training, Figure 9 As shown, the two models are pre-trained separately. After reaching a certain performance, they are fine-tuned using prior model knowledge to enable the model to better take into account the overall energy distribution and shape characteristics. The specific process is as follows:

[0142] First take As an interval, different optimization methods are used in different training stages. When epoch∈[0, ]Use the common numerical loss function, that is, optimize the two models Model1 and Model2 according to formula (12):

[0143] (12);

[0144] When epoch∈[ ,End], first predict through Model1 , and calculate MAE as area loss Then predict through Model2 , generate several control points based on the two parameters, and calculate the point density, zero-order moment, first-order moment and peak frequency respectively. Calculate the weighted accumulation of the above values ​​MAE as the shape loss , the two loss functions are defined as formula (13) and formula (14):

[0145] (13);

[0146] (14);

[0147] And at this stage, the area loss of each batch should be calculated separately and shape loss , and make sure to backpropagate the shape loss first , and then back-propagate the area loss This is because It is the loss of a specific frequency band, and numerical loss is needed to coordinate the global energy.

[0148] Secondly, the present invention enhances the convergence ability of the model in the later stage of training by using a dynamic learning rate adjustment mechanism. The computational graph is retained during the back propagation of to complete the parameter adjustments of two models simultaneously.

[0149] A computation graph is a data structure used to describe the computation process. During the backpropagation phase, the computation graph is used to calculate gradients. Preserving the computation graph avoids repeated construction during interactive optimization, saving computational overhead. Conversely, not preserving the computation graph can cause interference between the training of the two models and increase computational overhead.

[0150] Through segmented hybrid loss optimization, the present invention effectively solves the conflict between area loss and shape loss, enabling the neural network to take into account both energy accuracy and spectral shape fitting capabilities, providing a more accurate model for sea state prediction tasks. Figure 10 shown.

[0151] S4. To solve the parameter selection problem in the above optimization strategy, the present invention uses the particle swarm algorithm PSO to optimize the model training parameters. The specific process is as follows:

[0152] like Figure 12 As shown, the particle swarm algorithm PSO is used to optimize the hyperparameters of model training, including two learning rates, five loss weights and The specific process is as follows:

[0153] First, according to the number of parameters to be optimized , randomly initialize the particle swarm to In dimensional space:

[0154] (15);

[0155] The position of the particle represents a potential solution;

[0156] During the iteration process, the fitness calculation is performed, that is, the parameter combination corresponding to the particle position is substituted into the model training process, the final MAE is calculated, and the historical individual optimal solution of each particle is recorded. and the historical global optimal solution of the particle swarm :

[0157] (16);

[0158] (17);

[0159] The update rules for the velocity and position of the i-th particle are as follows, where the velocity update takes into account inertial motion, cognitive motion, and social motion:

[0160] (18);

[0161] (19);

[0162] (20);

[0163] in: is the current iteration number;

[0164] is the velocity of the particle;

[0165] is the inertia weight, which controls the search ability of the particle and is set to 0.7 in this embodiment;

[0166] and The self-cognition factor and social learning factor enable the particle to update its speed and position according to the individual and global optimal values. In this embodiment, both are set to 1.5;

[0167] and A random number in the range [0,1] to increase search diversity.

[0168] Classical two-dimensional particle swarm optimization Figure 11 shown.

[0169] In addition, the present invention specifies the learning rate, loss weight and The parameter space of the learning rate is limited to [10 -5 ,10 -1 ], the weights are limited to [0,1] to ensure the rationality of the parameters. The intermediate epochs are limited to [10,100] to ensure the stability of the model fine-tuning training process. Due to computing power limitations, the number of particles is 32 (the number of threads on the device) and the number of iterations is 20. The optimization target is 150 epochs. and sum.

[0170] S5. The coupled characteristics of the ship's three-degree-of-freedom motions of roll, pitch, and heave, coupled with the nonlinear influence of the complex external environment, make these dynamic interactions extremely difficult to accurately capture using traditional methods. In order to effectively address this challenge, the Cross Attention mechanism came into being. It can not only model the feature relationship between multiple inputs, but also calculate the attention weights and capture the dependency between them by taking one input as a query and the other input as a key and value, thereby more accurately characterizing the dynamic interactions between inputs. Unlike self-attention, cross-attention can handle complex interactions between different inputs, allowing the model to more flexibly adapt to the combination of multiple features. The calculation process of cross-attention is as follows: Figure 13 shown.

[0171] Based on inter-channel cross-attention, the present invention introduces a feature cross-attention mechanism specifically for ship motion response - Ship Response Feature Cross-Attention Mechanism SRFCA (Ship Response Feature Cross-Attention), which processes the coupling relationship of the ship's three-degree-of-freedom motion of roll, pitch and heave and the nonlinear influence of the complex external environment.

[0172] Different from the relationship between channel attention extraction convolution block and residual block, such as Figure 14-15 As shown in the figure, this method not only overcomes the limitations of residual blocks (the use of channel attention requires an equal number of channels), but also enables SRFCA to be applied to any network to fuse features from all degrees of freedom. It also more accurately captures the interactions between different degrees of freedom, dynamically adjusts weights, and identifies the coupling relationships between these degrees of freedom and the influence of external driving factors. In this way, the model not only improves accuracy when processing ship motion, but also enhances its adaptability to complex sea conditions.

[0173] Furthermore, the introduction of cross-attention enhances the model's interpretability. By clarifying the correlations between features, the model can provide a more reliable and interpretable basis for ship motion prediction and control, thereby promoting more efficient applications of ship dynamics modeling and control systems.

[0174] S6. Using ResCNN as the baseline network, we introduce SRFCA and combine it with the PSO algorithm to perform hyperparameter optimization and build the PSO-ShipMotionNet network. The specific process is as follows:

[0175] ResCNN is used as the benchmark network to test the performance of SRFCA and collaborative optimization strategies. Based on this, SRFCA is introduced and combined with the PSO algorithm for hyperparameter optimization. The final network constructed is the PSO-ShipMotionNet network, whose structure is as follows: Figure 16 shown.

[0176] The PSO-ShipMotionNet network is a neural network architecture that combines multi-stage feature extraction and SRFCA modules, making it particularly suitable for extracting coupled relationships in ship motion responses. The network receives several inputs, each of which is processed through an independent feature extraction path. Specifically, during feature extraction, the network uses convolution and SRFCA modules in multiple stages:

[0177] First, the three convolutional blocks in the first stage perform a preliminary extraction of each input feature. Then, the SRFCA module dynamically extracts the interactions between different inputs to generate a fused feature representation. After processing by the convolutional blocks and SRFCA modules in the first stage, the features enter the convolutional blocks in the second stage. At the same time, the residual connection mechanism is used to combine the output of the current stage with the features of the previous stage. The network then enters the third stage, extracting higher-order features through deeper convolutional blocks and again applying the SRFCA mechanism to fuse the features, strengthening the modeling of complex relationships between inputs. Finally, the network concatenates the features output by different paths and completes the prediction of the target task through a fully connected layer.

[0178] The introduction of the SRFCA module is the key innovation of the network. It can dynamically adjust the weight distribution of different input features, accurately capturing the coupling relationship between them and the influence of external driving factors. This design not only improves the network's ability in feature modeling, but also enhances its adaptability to multi-feature input, especially when dealing with complex multi-dimensional and strongly coupled problems.

[0179] PSO-ShipMotionNet can also accept frequency domain input. Taking roll, pitch, and heave as an example, for frequency domain input, the present invention uses the Welch method to calculate the power spectral density (PSD) and cross power spectral density (CPSD) of the three-degree-of-freedom motion, as shown in Equations (21) to (22):

[0180] (twenty one);

[0181] Where, is the number of segments, i.e., the number of overlapping segments into which the signal is split; is the length of the segment; is the normalization factor; Represent the signal for the signal samples No. Section 1 The value of the samples; is a window function, and in this embodiment, a Hanning window is selected; Basis functions in discrete Fourier transform;

[0182] (twenty two);

[0183] Where, is the number of segments, i.e., the number of overlapping segments into which the signal is split; is the length of the segment; is the normalization factor; and Signal samples represent the signal No. Section 1 samples and No. Section 1 The value of the samples; is a window function. In this embodiment, the Hanning window is selected. and are the basis functions in the discrete Fourier transform.

[0184] First, each signal is divided into several segments with a length of 512 samples and 50% overlap, and then a window function is applied to each segment to reduce the spectrum leakage effect; each segment is subjected to a fast Fourier transform (FFT) to calculate its own spectrum, and the autopower spectrum (PSD) of each signal is estimated based on these spectra. In addition, by calculating the cross-power spectrum (CPSD) of paired signals, their correlation information at different frequencies is obtained, and only data with a frequency range of 0 to 0.3 Hz is retained to focus on its low-frequency response. PSD, CPSD-Real, and CPSD-Imaginary are concatenated and used as inputs in turn. The model input method is as follows: Figure 17 shown.

[0185] S7. Use the boundary element method to simulate the wave-ship motion response and construct a data set, randomly dividing it into training set, validation set and test set. The training set is used for model training under different experimental conditions, and the test set is used for sea condition prediction.

[0186] Dataset construction:

[0187] In the simulation, a specific wave spectrum and a light-type directional distribution function are used, such as formula (23). The spectral peak correction factor of this embodiment takes an average value of 3.3:

[0188] (twenty three);

[0189] in, is the directional expansion factor; is the main direction of the wave; is the gamma function;

[0190] The length between perpendicular lines of the simulated ship model is L PP =105m, the ship's width is B=18m, the draft is d=5.4m, and the total displacement is , its three-dimensional model is as follows Figure 18 shown.

[0191] The simulated ship model has specific parameters, as shown in Figure 1. The sea state sampling range includes significant wave height, crest frequency, expansion factor and relative direction;

[0192] Table 1 Sea state sampling range

[0193] ;

[0194] This example only predicts the significant wave height and peak frequency. Other parameters are introduced to increase the complexity of the dataset. Finally, the training set, validation set, and test set are randomly divided. The validation set is used to observe the training process without comparing any results.

[0195] Training settings:

[0196] The operating system used in this paper is Windows, the GPU is 12GB GeForce RTX 3080Ti, CUDA 12.6, the programming language is Python 3.9, and the model training framework is based on PyTorch 2.4.1. The dataset normalization method uses MaxAbs to scale the data to [ ] range. The training sample batch size is set to 300. In order to fairly evaluate the performance differences between models, the same test set is used for prediction. The network hyperparameters and topology structure are based on previous studies. The specific parameter combinations are shown in Table 2:

[0197] Table 2 Grid hyperparameters

[0198] ;

[0199] The present invention sets up four experimental conditions, namely Scheme 1 without introducing SRFCA and using segmented optimization, Scheme 2 without introducing SRFCA and using segmented optimization, Scheme 3 with only introducing SRFCA and not using segmented optimization, and Scheme 4 with introducing SRFCA and using segmented optimization, as shown in Table 3. The purpose of dividing the conditions in this way is to directly compare the effects of SRFCA and segmented optimization without changing the basic model.

[0200] Table 3 Experimental conditions

[0201] ;

[0202] The initial learning rate, loss weight and segmented optimization of the above working conditions All of the results were obtained using particle swarm optimization, as shown in Tables 4 and 5. The loss types corresponding to each weight are shown in step S3. The maximum epoch is set to 150, and the learning rate decay coefficient is 0.995. The validation set loss of each scheme basically converged by the 120th epoch, with no signs of overfitting.

[0203] Table 4. Training hyperparameters for time domain input

[0204] ;

[0205] Table 5. Training hyperparameters for frequency domain input

[0206] ;

[0207] S8. Based on the prediction results under time domain input and frequency domain input, analyze the impact of SRFCA and segmented optimization strategy on model performance.

[0208] Results under time domain input

[0209] Time domain input The prediction results are as follows Figure 19 As shown in Figure 2, the predicted points are more concentrated in Scheme 2 compared to Scheme 1, indicating better stability in data fitting. This is the result of the physical loss introduced by the segmented optimization. A similar observation can be made by comparing Schemes 3 and 4.

[0210] Compared with Scheme 1, Scheme 3 has slightly better prediction results, indicating that the introduction of SRFCA has improved prediction accuracy to a certain extent. Compared with Scheme 2, Scheme 4 has a more concentrated area of ​​4-6m true values, indicating that the introduction of SRFCA has improved the generalization ability of the model to a certain extent.

[0211] And as Figure 20 Comparing the distribution of absolute residuals, Scheme 2 has a higher number of errors in the small residual range [0, 0.4] and a very low number in the large residual range [1.02, 3.5]. This indicates that after piecewise optimization, the errors of more samples are concentrated in the smaller error range, improving prediction accuracy. In contrast, Scheme 1's distribution may be more "scattered," or more samples appear at larger residuals. This suggests that without piecewise optimization, the model's adaptability to certain samples is insufficient, resulting in a wider overall error distribution. This indicates that piecewise optimization significantly improves local prediction accuracy. In the range [0.4, 1.02], the distributions of the two are similar, but some improvement is achieved.

[0212] Scheme 3 outperforms Scheme 1 across the entire range. This demonstrates that SRFCA improves the model's feature extraction capabilities, meaning it can more accurately identify the coupling between the three-degree-of-freedom responses and significantly increases the number of samples within the small residual error range [0, 0.3]. This suggests that the introduction of SRFCA improves the model's overall prediction accuracy, reducing most prediction errors. Scheme 3 exhibits a lower magnitude in the medium error range [0.4, 0.8], indicating that SRFCA primarily reduces smaller errors. Scheme 3 exhibits slightly fewer errors in the range [1, 3.5] than Scheme 1, but still exhibits some extreme errors. This suggests that SRFCA has a limited effect on suppressing large errors.

[0213] Finally, the error distribution for scheme 4 is good. Although the concentrated segment shifts from [0, 0.04] in scheme 3 to [0.08, 0.12], the number of samples within the error range of [1, 3.5] is significantly reduced. This suggests that the simultaneous introduction of SRFCA and the segmented optimization strategy may present a "competitive" situation. However, it also demonstrates that the simultaneous introduction of SRFCA and the segmented optimization strategy preserves generalization capabilities, significantly improves local prediction accuracy, and reduces error spikes in certain specific intervals. It also enhances the model's learning ability, achieving optimal predictive performance, concentrating the absolute residual distribution more closely within the small error interval and significantly reducing the large error tail.

[0214] Figure 21 Shows the time domain input Predicted situation, but because it is not like The results have been significantly improved. Observation shows that Scheme 4 performs best, with the most concentrated distribution of prediction points, smaller errors, and a higher degree of fit near the diagonal, consistent with its lowest mean absolute error (MAE) and mean square error (MSE). Scheme 1 has the largest error, with more dispersed prediction points and a higher number of large error points in areas with low true values.

[0215] Compare the time domain input Regarding the distribution of absolute residuals, after the introduction of segmented optimization in Scheme 2, the residual distribution is significantly concentrated in the range [0, 0.02], with a significant increase in number. This demonstrates that segmented optimization effectively reduces prediction error through local modeling and captures the local characteristics of the system. The presence of multiple small peaks in the range [0.08, 0.4] reflects the differences in system behavior under different samples, but their number is lower than that of Scheme 1, indicating that segmented optimization has a certain degree of adaptability.

[0216] Scheme 3, however, saw a significant increase in the number of samples within the small error range [0, 0.02], significantly improving prediction accuracy. This demonstrates that SRFCA enhances global prediction capabilities. Within the large residual error range, the distribution decreased slightly compared to Scheme 1 but was not as effective as Scheme 2, indicating that while SRFCA alone provided some improvement, it still had limitations.

[0217] The residuals for Scheme 4 are almost entirely concentrated in the extremely low range [0, 0.02], with a total of 4173 samples. The number of samples in the range [0.08, 0.4] further decreases. This demonstrates that SRFCA and segmented optimization complement each other: SRFCA corrects global errors, while segmented optimization fine-tunes local features. The combination of the two achieves extremely high prediction accuracy.

[0218] like Figure 22 The results are shown in the frequency domain input, such as Figure 23 The results shown are for frequency domain input. Although the wave spectrum parameter prediction task performed well under frequency domain input, the introduction of SRFCA and the segmented optimization strategy further improved the parameter prediction accuracy. Both of them show good application prospects in this task.

[0219] Therefore, the present invention adopts the aforementioned sea state prediction method based on PSO-ShipMotionNet and a spectral-guided optimization strategy. This method offers significant advantages. In terms of algorithms and models, it utilizes multiple techniques to build a network, reducing reliance on sample size. In terms of performance, it achieves more accurate predictions, improves precision and stability, reduces large errors, and enhances generalization capabilities when using time and frequency domain inputs. Furthermore, it enhances the physical interpretability of neural networks, providing a reliable new solution for related fields.

[0220] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy, characterized by: The following steps are involved: S1, using intra-sample MaxAbs normalization, normalization is performed within a single sample; S2, using the Goda modified form of Jonswap spectrum to construct the loss function, calculate the area integral of the true spectrum and the predicted spectrum in a specific frequency band, and use the mean absolute error (MAE) as the energy-related loss; S3, using a segmented hybrid loss optimizer to optimize the area and specific frequency band shape respectively; S4. Use the particle swarm algorithm (PSO) to optimize the model training parameters, where Model 1 focuses on area optimization, and the other model Model 2 is responsible for optimizing the shape of a specific frequency band; S5. Introducing the Ship Response Feature Cross Attention (SRFCA) mechanism to handle the coupling relationship between the ship's roll, pitch, and heave motions and the nonlinear effects of the complex external environment. S6. Using ResCNN as the baseline network, we introduce SRFCA and combine it with the PSO algorithm to perform hyperparameter optimization and build the PSO-ShipMotionNet network. S7. Use the boundary element method to simulate the wave-ship motion response based on the specific wave spectrum and the optical directional distribution function, and construct a data set. The data set is randomly divided into training set, validation set, and test set. The training set is used for model training under different experimental conditions, and the test set is used for sea state prediction. S8. Based on the prediction results under time domain input and frequency domain input, analyze the impact of SRFCA and segmented optimization strategy on model performance.

2. The sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy according to claim 1 is characterized in that: S1 is specifically: Calculate the maximum absolute value of all values ​​within each sample, and divide all eigenvalues ​​by the maximum absolute value to compress the values ​​within the sample to [ ] scope; After the loss term is normalized, when searching for loss weights, the weights are initialized in the range [0, 1] to narrow the search space; In addition, during the normalization process, a small value limit is introduced to prevent division by zero errors caused by random initialization.

3. The sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy according to claim 2 is characterized in that: The specific process of S2 is: The loss function is constructed using the Goda modified form of the Jonswap spectrum. The area enclosed by the energy spectrum function and the horizontal axis of the coordinate is the zero-order moment, as shown in formula (1), which represents the sum of the energy within the frequency range; (1); In the formula is the shape coefficient, ; is the peak shape factor; is the spectrum peak period, in seconds; is the significant wave height, in meters; is the frequency, in Hertz; is the shape coefficient, ; Therefore, formula (2) can be derived from formula (1), that is, there is a positive correlation between the significant wave height and the zero-order moment; (2); (3); When the peak frequency is fixed and form factor When the significant wave height is an important indicator to measure the zero-order moment, the area integral of the real spectrum and the predicted spectrum of a specific frequency band is calculated respectively, and the mean absolute error is further calculated. As energy-related losses, it is calculated as follows: (4); (5); (6); The frequency points of the spectral function are normalized within the sample, and the energy spectrum curves under different parameter combinations are unified into one scale. After normalization, the shape of the energy spectrum curve is only related to the spectrum peak frequency. Compute the energy density difference between all frequency points as a complement to the peak difference description: (7); The area first moment of energy spectrum MAE is introduced as part of the shape loss; (8); (9)。 4. The sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy according to claim 3 is characterized in that: The specific process of S3 is as follows: A segmented hybrid loss optimizer is used to optimize the area and shape of a specific frequency band separately. During the model training process, the two models are first pre-trained separately, and then fine-tuned using prior model knowledge to make the model take into account both the overall energy distribution and shape characteristics. The specific process is as follows: First take As an interval, different optimization methods are used in different training stages. Use the common numerical loss function, that is, optimize Model1 and Model2 according to formula (10): (10); when , first predict through Model1 , and calculate MAE as area loss , and then predict through Model2 , generate several control points according to the two parameters, calculate the point density, zero-order moment, first-order moment and peak frequency respectively; calculate the weighted accumulation of the above values ​​MAE as the shape loss , the two loss functions are defined as formula (11) and formula (12): (11); (12); Calculate the area loss for each batch separately and shape loss , and first back-propagate the shape loss , and then back-propagate the area loss ; Use dynamic learning rate adjustment mechanism to enhance the convergence ability of model training in the later stage by The computational graph is retained during the back propagation of to complete the parameter adjustments of two models simultaneously.

5. The sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy according to claim 4 is characterized in that: The specific process of S4 is as follows: The particle swarm algorithm PSO is used to optimize the hyperparameters of model training, including two learning rates, five loss weights and The specific process is as follows: First, according to the number of parameters to be optimized , randomly initialize the particle swarm to In dimensional space: (13); The position of the particle represents a potential solution; During the iteration process, the fitness calculation is performed, that is, the parameter combination corresponding to the particle position is substituted into the model training process, the final MAE is calculated, and the historical individual optimal solution of each particle is recorded. and the historical global optimal solution of the particle swarm : (14); (15); The update rules for the velocity and position of the i-th particle are as follows, where the velocity update takes into account inertial motion, cognitive motion, and social motion: (16); (17); (18); in: is the current iteration number; is the velocity of the particle; is the inertia weight, which controls the particle’s search ability; and The self-cognition factor and social learning factor enable particles to update their speed and position according to individual and global optimal values; and A random number in the range [0,1] to increase search diversity.

6. The sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy according to claim 5 is characterized in that: The specific process of S6 is as follows: Using ResCNN as the baseline network, we introduce SRFCA and combine it with the PSO algorithm for hyperparameter optimization to construct the PSO-ShipMotionNet network. The PSO-ShipMotionNet network receives several input data, each of which is processed by an independent feature extraction path, that is, using convolution and SRFCA modules in multiple stages: First, each input feature is preliminarily extracted through the three convolution blocks in the first stage; then, the SRFCA module is used to dynamically extract the interaction relationship between different inputs to generate a fused feature representation; after being processed by the convolution blocks and SRFCA modules in the first stage, the features enter the convolution blocks in the second stage. At the same time, the residual connection mechanism is used to combine the output of the current stage with the features of the previous stage; then, the network enters the third stage, extracting high-order features through deeper convolution blocks, and again applying the SRFCA mechanism to fuse the features.

7. The sea state prediction method based on PSO-ShipMotionNet and spectrum-guided optimization strategy according to claim 6 is characterized in that: In S7, a specific wave spectrum and light-type directional distribution function are used, such as formula (19): (19); in, is the directional expansion factor; is the main direction of the wave; is the gamma function; The simulated ship model has specific parameters, and the sea condition sampling range includes significant wave height, crest frequency, directional expansion factor and main direction; the training set, validation set and test set are randomly divided, and the validation set is used to observe the training process.

Citation Information

Patent Citations

  • Method for calculating structure stress of floating ocean structure based on spectrum analysis method

    CN107291995A

  • Ship motion forecasting method and system based on dynamic periodic pattern recognition and weighting

    CN119719685A