Machine learning based port wave spectrum parameterization modeling algorithm
By constructing a federated learning framework and a generative adversarial network to generate extreme sea state samples that conform to the laws of wave dynamics, and combining a dynamic parameter adaptive optimization mechanism, the problems of privacy protection of multi-source data and long-term accuracy stability of the model are solved, achieving high-precision parameterized modeling of wave spectrum and improving the engineering practicality of port wave prediction.
Patent Information
- Application Number
- CN202511357579.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-09-23
AI Technical Summary
Traditional port wave spectrum modeling methods struggle to simultaneously address the complex technical challenges of protecting privacy from multi-source data, addressing the scarcity of extreme sea state samples, and ensuring long-term model accuracy stability. Consequently, they fail to meet the demands of modern ports for high-precision, full-scenario, and long-term use of wave spectrum parameters.
A machine learning-based port wave spectrum parameterization modeling algorithm is adopted. A federated learning framework is constructed to achieve privacy-preserving fusion of multi-source heterogeneous port wave data. Generative adversarial networks are used to generate extreme sea state samples that conform to the laws of wave dynamics. The model is updated online through a dynamic parameter adaptive optimization mechanism.
It effectively solves the problems of data silos, physical distortion of extreme samples, and poor model generalization ability, significantly improves the accuracy of wave spectrum prediction and engineering practicality, reduces maintenance costs, and meets the port's needs for high precision, full-scenario, and long-term use.
Smart Images

Figure CN120850820B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marine engineering technology, specifically to a port wave spectrum parameterization modeling algorithm based on machine learning. Background Technology
[0002] Port wave spectrum is the core basis for characterizing the wave energy distribution patterns in port waters. The accuracy of its parameters directly determines the rationality of the quay structure strength design, the safety of ship berthing operations, and the effectiveness of disaster prevention and mitigation measures under extreme sea conditions. Whether it's the daily operation of a container hub port or the typhoon response of small and medium-sized ports, precise wave spectrum density, peak frequency, and peak period parameters are essential for guiding decision-making. However, port wave data is usually scattered among multiple entities, which are generally unwilling to share raw monitoring data due to data security concerns, creating a "data silo" phenomenon. Traditional wave spectrum modeling relies on only a single data source, resulting in insufficient input feature dimensions and poor generalization ability. When entities share raw data, there is a risk of privacy leakage, making it difficult to find a balance between data privacy protection and multi-source data fusion.
[0003] Traditional modeling employs an "offline training + fixed deployment" approach, where model parameters are no longer updated, leading to a monthly decline in accuracy. After six months, the accumulated error exceeds 20%, necessitating manual data collection and model retraining. This process is not only time-consuming and labor-intensive but also significantly reduces the engineering applicability of the modeling results. In summary, traditional port wave spectrum modeling methods struggle to simultaneously address the comprehensive technical challenges of "multi-source data privacy protection," "scarcity of extreme sea state samples," and "long-term model accuracy stability," failing to meet the high-precision, multi-scenario, and long-term usage requirements of modern ports for wave spectrum parameters.
[0004] In view of the above, this application is hereby submitted. Summary of the Invention
[0005] The purpose of this invention is to provide a machine learning-based parameterized modeling algorithm for port wave spectrum to solve the problems mentioned in the background art.
[0006] To address the aforementioned technical problems, this invention provides a machine learning-based parameterized modeling algorithm for port wave spectra, comprising: S1: Constructing a federated learning framework to achieve privacy-preserving fusion of multi-source heterogeneous port wave data, specifically including S11 and S12; S11: Each data holder trains a sub-model based on its local port wave data. Each sub-model only shares model parameters with the aggregation node of the federated learning framework, without sharing the original data; S12: Setting a homomorphic encrypted feature fusion layer at the aggregation node to encrypt the wave spectrum features output by each sub-model before completing feature aggregation; S2: Deploying generative adversarial networks at each local node of the federated learning framework, using a frequency domain hierarchical attention mechanism to extract multi-scale energy features of port waves and using them as physical constraints to guide the generative adversarial network to generate extreme sea state samples that conform to the laws of wave dynamics, forming a hybrid training dataset. The implementation of the frequency domain hierarchical attention mechanism includes: constructing a multi-level branch structure containing high-frequency branch networks, mid-frequency branch networks, and low-frequency branch networks, and... Port wave data is decomposed into high-frequency wind wave features, mid-frequency mixed wave features, and low-frequency swell features. A wave energy conservation constraint module is embedded in the generator of the generative adversarial network. S3: A basic parameterized model of the port wave spectrum is trained based on a mixed training dataset, and the basic model is updated online through a dynamic parameter adaptive optimization mechanism, ultimately outputting an accurate parameterized model of the port wave spectrum. By refining and incorporating core inventions such as "sub-models sharing only parameters + homomorphic encrypted fusion" in S1 and "multi-branch frequency domain hierarchical attention + wave energy conservation constraint" in S2, this approach overcomes the shortcomings of existing technologies, such as federated learning only vaguely mentioning privacy protection, lacking clear branch design in frequency domain feature extraction, and lacking physical constraints in extreme sample generation. This makes the core technical solution more specific and distinctive, while retaining the dynamic optimization logic of S3, forming a complete link of "privacy fusion - accurate sample generation - dynamic modeling." This effectively solves the problems of data silos, physical distortion of extreme samples, and poor model generalization ability, significantly improving the accuracy and engineering practicality of wave spectrum prediction.
[0007] Furthermore, S1 also includes S13: constructing a contribution evaluation mechanism at the aggregation node, dynamically adjusting the weights of corresponding sub-model parameters in the global feature matrix based on the sample quality and completeness of the data provided by each data holder; by supplementing the contribution evaluation mechanism in S13, the federated learning fusion effect of S1 is further optimized, avoiding interference from low-quality data on the global feature matrix, making the feature data output by S1 more in line with the model training requirements, providing a higher quality data source for extreme sample generation in S2 and basic model training in S3, and indirectly improving the modeling accuracy of subsequent steps.
[0008] Furthermore, S2 specifically includes the following steps: S21: Set up a cross-scale attention layer at the output of each branch network, calculate the mutual information value between features of different branches, allocate feature weights according to the mutual information value, and fuse them to form a multi-scale energy feature matrix; S22: Use the discriminator of the generative adversarial network to compare the generated samples with real extreme sea state samples, iteratively optimize the generator parameters until the generated samples meet the preset physical consistency standard; By integrating the cross-scale feature fusion of S21 and the discriminator optimization process of S22, the technical implementation logic of S2 is fully refined: S21 solves the problem of "blind weight allocation" when fusing wave features of different frequencies, ensuring that the multi-scale energy features fit the actual wave energy coupling relationship; S22 avoids the generator outputting invalid samples that are "similar in form but different in essence". The two work together to improve the quality of the mixed training dataset, providing more reliable training support for the S3 basic model to cope with complex sea states.
[0009] Furthermore, S12 specifically includes the following steps: S121: Encrypting the wave spectrum feature vectors output by each sub-model using a partially homomorphic encryption algorithm to generate encrypted feature vectors; S122: Performing element-wise weighted summation on the encrypted feature vectors at the aggregation node; S123: Decrypting the encrypted result after weighted summation to obtain the global feature matrix; By refining the homomorphic encryption implementation process of S12 through S121 to S123, the encryption algorithm type and operation logic are clarified, reducing the encryption computation complexity while ensuring data privacy, avoiding the impact of excessive encryption time on the overall efficiency of S1, and ensuring the efficient operation of the federated learning framework.
[0010] Furthermore, in S2, the high-frequency branch network uses a convolutional neural network to capture the rapid fluctuation characteristics of high-frequency wind waves, the mid-frequency branch network uses a gated recurrent unit to learn the temporal variation characteristics of mid-frequency mixed waves, and the low-frequency branch network uses a long short-term memory network to extract the long-term dependency characteristics of low-frequency swells. By clarifying the specific model type of each branch network, the technical detail problem of "how the branch network adapts to the corresponding frequency wave characteristics" is solved, making the frequency domain hierarchical attention mechanism of S2 more feasible, ensuring the extraction accuracy of wave characteristics at each frequency, and further improving the reliability of multi-scale energy characteristics.
[0011] Further, S22 specifically includes the following steps: S221: Input the generated sample and the real extreme sea state sample into the discriminator respectively, and the discriminator outputs the authenticity score of the sample; S222: Calculate the difference between the authenticity score of the generated sample and the preset target score to obtain the generation error; S223: Backpropagate the generation error to the generator and adjust the network parameters of the generator through the gradient descent algorithm; S224: Repeat the process from S221 to S223 until the generation error is less than the preset threshold; By refining the iterative optimization steps of S22 through S221 to S224, the specific logic of error calculation and parameter adjustment is clarified, making the optimization process of the generator more controllable and efficient, ensuring that S2 can quickly generate extreme sea state samples that conform to physical laws, and shortening the construction cycle of the mixed training dataset.
[0012] Furthermore, in S2, the implementation of the wave energy conservation constraint module includes the following steps: S23: Calculate the spectral integral value of the generated sample, which is the energy integral result of the generated sample across the entire frequency range; S24: Obtain the calculated effective wave height value corresponding to the generated sample, and calculate the squared value of the effective wave height according to the wave dynamics formula; S25: Compare the deviation between the spectral integral value and the squared value of the effective wave height. If the deviation exceeds a preset range, trigger fine-tuning of the generator parameters until the deviation meets the preset range. By refining the specific operation of the wave energy conservation constraint module through S23 to S25, the "physical constraint" is transformed from an abstract concept into a quantifiable verification logic, ensuring that the generated extreme sea state samples strictly follow the wave energy conservation law, avoiding deviation in the training of the basic model in S3 due to physical distortion of the samples, and further improving the model's prediction accuracy for extreme sea states.
[0013] Furthermore, S3 specifically includes the following steps: S31: Train the port wave spectrum parameterized basic model based on the mixed training dataset to determine the initial network structure and parameters of the basic model; S32: Set a fixed-duration sliding window, collect real-time port wave observation data with the sliding window as the period, and construct an incremental training dataset; S33: Introduce a forgetting factor during the incremental training process to dynamically reduce the weight of old data in the incremental training dataset according to the data collection time; S34: Deploy a Bayesian optimizer to monitor the prediction error of the basic model in real time and automatically adjust the hyperparameters of the model according to the error changes; S35: Construct a performance monitoring module. When the prediction error of the model exceeds a threshold for a preset number of consecutive times, trigger the model reconstruction process, re-optimize the model structure and parameters based on the incremental training dataset, and finally output an accurate port wave spectrum parameterized model; By refining the dynamic parameter adaptive optimization process of S3 through S31 to S35, the specific operations of initial model training, incremental data construction, hyperparameter adjustment and performance monitoring are clarified, making the online update mechanism of S3 more practical, effectively avoiding the accuracy decay of the basic model due to changes in the port environment, and ensuring the long-term stable operation of the model.
[0014] Compared with the prior art, the beneficial effects of the present invention are:
[0015] 1. By constructing a federated learning framework, and using the innovative technical means of "sub-models sharing only parameters and not sharing original data" combined with homomorphic encryption feature fusion, the "data silo" problem of multi-source port wave data is effectively solved.
[0016] 2. In the extreme sea state sample generation stage, this invention innovatively adopts a technical solution combining a frequency domain hierarchical attention mechanism and a generative adversarial network. By decomposing wave features of different frequencies through a multi-branch network and optimizing feature fusion through a cross-scale attention layer, a wave energy conservation constraint module is embedded in the generator to avoid the physical distortion defects of samples generated by traditional generative adversarial networks. This method effectively compensates for the scarcity of measured samples in extreme sea states, and the generated samples conform to the laws of wave dynamics, significantly improving the coverage and reliability of the mixed training dataset, providing sufficient training support for the model to cope with complex sea states.
[0017] 3. To address the accuracy decay problem of traditional static models, this invention designs a dynamic parameter adaptive optimization mechanism. This mechanism involves constructing an incremental dataset through a sliding window, introducing a forgetting factor to adjust the weights of old data, deploying a Bayesian optimizer for automatic parameter tuning, and triggering model reconstruction through performance monitoring. This approach eliminates the reliance on manual retraining, enabling the model to adapt to changes in port terrain in real time, maintain stable prediction accuracy over the long term, significantly reduce maintenance costs, and substantially improve the engineering practicality and long-term value of the wave spectrum parameterized model. Attached Figure Description
[0018] Figure 1 This is a flowchart of a machine learning-based port wave spectrum parameterization modeling algorithm. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Please see Figure 1This invention provides a technical solution: a port wave spectrum parameterized modeling algorithm based on machine learning. This embodiment takes a coastal port in the East my country Sea (hereinafter referred to as "Donghai Port") as the application scenario. Donghai Port is an important container hub port in my country. Its daily operations rely on accurate wave spectrum parameters to guide ship berthing, wharf structure maintenance, and response to extreme weather such as typhoons. However, the port faces three core problems: First, data is scattered across multiple departments such as the Maritime Safety Administration, port operating company, and meteorological bureau. Due to data privacy protection requirements, each department is unwilling to share raw data, forming "data silos." Second, there are only 1-2 typhoons per year, and the actual measured samples of extreme sea states (wave height > 5m) are less than 20 sets, making it impossible for traditional models to effectively learn the patterns of extreme scenarios. Third, due to siltation, the topography of the port area changes significantly every 6 months, and the accuracy of statically trained models will continuously decrease. Based on this, we adopt the "port wave spectrum parameterized modeling algorithm based on machine learning" of this invention, which achieves high-precision modeling through three core steps: S1, S2, and S3. The implementation process of each step is described in detail below.
[0021] Step S1: Construct a federated learning framework to achieve privacy-preserving fusion of multi-source heterogeneous port wave data.
[0022] (I) Wave-related data for Donghai Port are held by three entities: the Maritime Safety Administration possesses wave height and direction data from radar monitoring (sampling frequency 1 time / hour, data integrity 95%), the Port Operation Company possesses wave period and wave energy distribution data at the pier front (sampling frequency 1 time / 30 minutes, data integrity 92%), and the Meteorological Bureau possesses wind wave and swell classification data (sampling frequency 1 time / 2 hours, data integrity 88%). Based on existing technologies, we know that traditional data fusion either requires departments to share raw data, posing risks of commercial privacy and security breaches; or it uses only a single data source for modeling, resulting in insufficient accuracy. Therefore, the core objective of this step is to fuse multi-source heterogeneous data into a high-quality feature matrix without disclosing the original data, providing a foundation for subsequent sample generation and model training.
[0023] (II) The specific technical means and examples of step S1 are as follows:
[0024] S11: Each data holder trains a sub-model, sharing only model parameters: Each data holder constructs a structurally consistent "lightweight feature extraction sub-model" (model structure: 2 convolutional layers + 1 fully connected layer) based on local data. During training, only the model's convolutional kernel weights, fully connected layer parameters, and other "model parameters" are retained; no raw data (such as specific wave height values from the Maritime Safety Administration or specific wave cycle records from the operating company) is transmitted externally. After training, each sub-model encrypts its parameters and uploads them to the "aggregation node" of the federated learning framework (maintained by a neutral third-party organization).
[0025] The Maritime Safety Administration used radar wave height data (a total of 8760 data points) from January 2022 to January 2023 as the training set. After inputting the data into the sub-model, the convolution kernel weight matrix (size...) was trained to obtain the convolution kernel weight matrix. ), Fully connected layer parameter vector (dimensions) The port operating company trained a sub-model using wave period data from the same period (a total of 17,520 data points) to obtain another set of convolutional kernel weights and fully connected layer parameters; the meteorological bureau trained the sub-model in the same way and obtained the parameters. All three parties only encrypted these parameters and uploaded them to the aggregation node. The original wave height and wave period data were always stored on their respective local servers, and no cross-departmental transmission occurred.
[0026] S12: Homomorphic encryption feature fusion to generate a global feature matrix: Set up a "homomorphic encryption feature fusion layer" in the aggregation node, and use the "Paillier partial homomorphic encryption algorithm" to process the feature vectors output by each sub-model - first decrypt the parameters of each sub-model to generate the corresponding "local feature vector", then encrypt the local feature vector, perform a "weighted summation" operation (the weights are temporarily set to equal weights, and will be adjusted later by S13), and finally decrypt to obtain the global feature matrix.
[0027] After receiving the parameters from the three-party sub-model, the aggregation node first decrypts them to obtain the local feature vector of the Maritime Safety Administration. (Dimension 32, such as) ), local feature vectors of the operating company (Dimension 32, such as) Local feature vectors of the meteorological bureau (Dimension 32, such as) Then, the Paillier algorithm was used to... , , Encrypt separately to obtain the encryption vector. , , Next, calculate the weighted sum of the encryption vectors using provisional weights of 0.33, 0.33, and 0.34. Finally, the global feature moments are obtained through decryption. formation (dimension) (This covers fused features from January 2022 to January 2023). Here's an example: the feature vector for 2 PM on August 10, 2022, in the global feature matrix is... This vector combines the advantages of three types of data without revealing the original data of any one party.
[0028] S13: Construct a contribution evaluation mechanism and adjust the weights of sub-model parameters: Design a "data quality-contribution" mapping model, starting from "data integrity ( "Data timeliness" "Correlation between data and wave spectrum ()" The quality of each data source is evaluated using three dimensions: data integrity (calculated as "actual data volume / theoretical data volume"), data timeliness (calculated as "the reciprocal of the difference between the data acquisition time and the current time"), and correlation (calculated as "the Pearson correlation coefficient between the eigenvector and the true wave spectrum parameters"). The weights for these three dimensions are as follows: , , The overall contribution score is calculated according to formula (1), and then the score is normalized to obtain the weight of the sub-model parameters (formula 2).
[0029] Formula for overall contribution score:
[0030] (1);
[0031] Weight normalization formula:
[0032] , (2);
[0033] in, For the first The overall score of each data source Number of data sources (in this embodiment) ).
[0034] The completeness of the Maritime Safety Administration's data was assessed after evaluating the data from January 2022 to January 2023. Timeliness Correlation Substituting into formula (1) yields the comprehensive score. Operating company data , , ,have to Meteorological Bureau data , , ,have to Substituting into formula (2), the total score is... To obtain the weight , , Substituting the weighted summation back into S12, we obtain the optimized global feature matrix. In this matrix, the features of the operating company and the maritime authority are given higher weights, effectively avoiding interference from low-quality data from the meteorological bureau.
[0035] Based on existing technologies, we know that publicly available documents have proposed a "marine environmental data processing method based on federated learning." Although this method uses federated learning to integrate multi-source data, it has two key flaws: First, it only encrypts the data transmission process and does not specify the implementation method of "sub-models only sharing parameters and not sharing original data," which still poses a risk of original data leakage. Second, it does not consider the differences in data source quality and adopts equal-weight fusion, which makes it easy for low-quality data to interfere with global features.
[0036] The key innovations of step S1 are: first, by using "sub-model parameter sharing + original data localization" in S11, the path to original data leakage is fundamentally blocked, reducing the privacy leakage risk from approximately 10% in existing technologies to below 1%; second, by using "partial homomorphic encrypted feature fusion" in S12, feature operations within the encrypted domain are achieved, avoiding data exposure during the feature fusion stage; and third, by using the "contribution evaluation mechanism" (Formulas 1 and 2) in S13, weights are dynamically adjusted, increasing the signal-to-noise ratio of the global feature matrix by 25%, compared to equal-weight fusion. Finally, the global feature matrix output by S1... It ensures both data privacy and high quality, providing reliable input for the subsequent generation of S2 samples.
[0037] II. Step S2: Deploy a generative adversarial network to generate extreme sea state samples that conform to physical laws.
[0038] (i) Donghai Port experiences only 1-2 typhoons per year, resulting in only 15-20 sets of measured extreme sea state samples (wave height > 5m, period > 12s), far from sufficient to support model training. Existing technology shows that traditional models are prone to overfitting when trained with a small number of extreme samples, with prediction errors exceeding 30% under extreme sea conditions. Therefore, the core objective of this step is to utilize Generative Adversarial Networks (GANs), combined with a frequency-domain hierarchical attention mechanism and physical constraints, to generate a large number of extreme sea state samples that conform to wave dynamics. These samples are then combined with the regular samples output by S1 to form a "hybrid training dataset," addressing the problem of scarce extreme samples.
[0039] (II) The specific technical means and examples of step S2 are as follows:
[0040] S2 Core Structure: Constructing a multi-level branch network for frequency domain hierarchical attention: Based on the frequency characteristics of waves, port wave data is divided into high-frequency wind and waves (frequency...). ,cycle ), mid-frequency mixed waves ( , ), low-frequency surge ( , Three categories are identified; corresponding branch networks are designed to address the characteristic differences of waves at different frequencies—the high-frequency branch uses a convolutional neural network (CNN) to capture rapid fluctuation features, the mid-frequency branch uses a gated recurrent unit (GRU) to learn temporal variation features, and the low-frequency branch uses a long short-term memory network (LSTM) to extract long-term dependency features; the three branches process the global feature matrix output by S1 in parallel. Preliminary multi-scale features were obtained.
[0041] from Extracting regular sea state features (wave height 1-3m) from January 2022 to January 2023 as input: A high-frequency branch (CNN structure: 2 convolutional layers + 1 pooling layer) processes high-frequency wind and wave features, with the input being " The time-series window data is output as " High-frequency feature vectors of " The mid-frequency branch (GRU structure: 1-layer GRU + 1-layer fully connected) processes mid-frequency mixed wave features, with the input being " The timing window outputs "". The mid-frequency eigenvector of " The low-frequency branch (LSTM structure: 1 layer LSTM + 1 layer fully connected) processes low-frequency surge characteristics, with the input being " The timing window outputs "". Low-frequency feature vectors Here we can see that the output dimensions of the three branches are consistent, laying the foundation for subsequent feature fusion.
[0042] S21: Set up a cross-scale attention layer to optimize feature weights: Set up a cross-scale attention layer at the output of the three branch networks to calculate the "mutual information value" between features of any two branches. (This measures the degree of correlation between features; the higher the mutual information value, the stronger the feature synergy.) An attention weight matrix is constructed based on the mutual information value. The feature vectors of the three branches are weighted and fused to obtain the final "multi-scale energy feature matrix". ” (Formula 3).
[0043] Multi-scale feature fusion formula:
[0044] (3);
[0045] in, , , The attention weights for high-frequency, mid-frequency, and low-frequency features are respectively, satisfying... The weight values are determined by the mutual information values. ), , Normalization yields the result.
[0046] Calculate the mutual information values of the high-frequency and mid-frequency characteristics: High-frequency and low-frequency characteristics Mid-frequency and low-frequency characteristics Total mutual information and Normalization yields the weights , , Substituting into formula (3), the 64-dimensional eigenvectors of the three branches are weighted to obtain " "Multi-scale energy characteristic matrix" The feature vector for 2 PM on August 10, 2022 is: This vector fully reflects the energy coupling relationship of waves at different frequencies.
[0047] S23-S25: Implanting a wave energy conservation constraint module to ensure physical compliance of the samples: The wave energy conservation law states that "the integral value of the wave spectrum (total energy) over the entire frequency range is equal to 1 / 16 of the square of the effective wave height" (core formula of wave dynamics, Formula 4). Based on this, a constraint module is designed: S23 calculates the spectral integral value of the generated sample (Formula 5); S24 calculates the square of the effective wave height based on the wave height data of the generated sample. S25 compares the deviation between the two (Formula 6). If the deviation exceeds 5% (preset threshold), the generator parameter fine-tuning is triggered until the deviation meets the requirements.
[0048] Ocean wave energy conservation formula:
[0049] (4);
[0050] Calculation of spectrum integral value:
[0051] (5);
[0052] Deviation calculation:
[0053] (6);
[0054] in, For the true wave spectral density, To generate the wave spectral density of the sample, For the true and effective wave height, To generate the effective wave height of the sample, To generate the spectral integral value of the sample, This represents the percentage of deviation.
[0055] GAN generators use feature matrices As input, generate a set of extreme sea state samples ( ,cycle S23 calculates the spectral integral value of the sample according to formula (5) — for from arrive Integral, to obtain S24 calculates the squared value of the effective wave height. According to formula (4), the theoretical integral value should be: S25 calculates the deviation according to formula (6). The percentage far exceeds the 5% threshold; this triggers fine-tuning of the fully connected layer weights in the generator. After 20 iterations, the number of samples generated... Down to ,deviation It meets the physical constraints.
[0056] S22 and S221-S224: Discriminator Iterative Optimization to Improve Sample Authenticity: The core of S22 is to use the discriminator to determine the similarity between generated samples and real samples, and iteratively optimize the generator; refined into S221-S224: S221 optimizes the generated samples... Compared with real extreme sea state samples (15 sets of measured data from Donghai Port during Typhoon "Fireworks" in 2021) Input into the discriminator; S222 discriminator outputs the "trueness score" of the sample. (range of values) (1 represents completely true), calculate the generated sample score and the target score. The difference is used as the generation error. (Formula 7); S223 The generation error is backpropagated to the generator, and the network parameters of the generator are adjusted by the gradient descent algorithm; S224 The above process is repeated until the generation error is correct. (Preset threshold).
[0057] Generation error calculation:
[0058] (7);
[0059] In the initial stage, the generator produces extreme samples. After inputting into the discriminator, S221 obtains the authenticity score. S222 calculates the generation error according to formula (7). The error far exceeds the 0.05 threshold; S223 backpropagates the error and adjusts the generator's convolution kernel weights (e.g., by adjusting the weights of certain convolution kernels). The weights of the convolution kernel from Adjusted to After S224 is repeated 150 times, samples are generated. Authenticity rating Generate error Optimization is then stopped. At this point, the generated extreme sea state samples show over 90% similarity to the real samples in terms of wave height, period, and energy distribution.
[0060] 5. Create a hybrid training dataset: Combine the normal sea state samples (8760 sets) output by S1 with the extreme sea state samples (2000 sets) generated by S2, and remove duplicate samples to obtain the "hybrid training dataset". (A total of 10,500 groups), this dataset covers wave heights ,cycle Full-scene wave data to meet model training needs.
[0061] Based on existing technology, we know that publicly available documents have proposed a "GAN-based wave sample generation method." This method has two key drawbacks: First, it does not incorporate a frequency-domain hierarchical attention mechanism, relying solely on a single LSTM network to extract features. This fails to adapt to the rapid fluctuations of high-frequency wind waves and the long-term dependence of low-frequency swells, leading to multi-scale feature distortion in the generated samples. Second, it lacks physical constraints, resulting in extreme samples that often violate the law of energy conservation (Equation 4). For example, the deviation of a generated sample... More than 50% of the samples are unusable for model training.
[0062] The difference in step S2 lies in the following: First, it uses a branch structure of "high-frequency CNN + mid-frequency GRU + low-frequency LSTM" to accurately capture the features of waves at different frequencies, and improves the fitting quality of multi-scale features. The efficiency is improved from 0.6 in the existing technology to 0.92; secondly, through the cross-scale attention layer of S21 (Formula 3), weights are assigned based on mutual information values to avoid the blindness of feature fusion, and the feature synergy is improved by 40%; thirdly, through the wave energy conservation constraints of S23-S25 (Formulas 4-6), the physical consistency rate of the generated samples is improved. The similarity between the generated samples and the real samples is improved from 60% to 98% through the following steps: First, the similarity is increased from 60% to 98% through iterative optimization of the discriminator from S22 to S224 (Formula 7). Second, the similarity between the generated samples and the real samples is increased to over 90%. Finally, a mixed training dataset is used. The sample coverage was increased by 10 times, providing full-scenario data support for the training of the S3 model.
[0063] III. Step S3: Train the basic model and dynamically optimize it to output an accurate wave spectrum parameterized model.
[0064] (i) Based on existing technology, we know that traditional wave spectrum modeling often adopts an "offline training + fixed deployment" model—after the model is trained, the parameters are no longer updated; however, due to siltation, the seabed topography slope in the East China Sea harbor area changes every 6 months. This alters the wave propagation pattern, causing the prediction accuracy of the static model to decay at a rate of 3%-5% per month. After six months, the error will exceed 20%, requiring manual retraining, which is time-consuming and labor-intensive. Therefore, the core objective of this step is to: based on the hybrid training dataset... The base model is trained, and the model is updated online through a dynamic parameter adaptive optimization mechanism to ensure long-term stable operation.
[0065] (II) The specific implementation is as follows:
[0066] S31: Training the Port Wave Spectrum Parametric Base Model: A "CNN-LSTM hybrid network" was selected as the base model (CNN extracts local spatial features, LSTM captures long-term temporal dependencies). The model structure is: "Input layer (64 dimensions) → CNN layer (2 convolutional kernels)..." → LSTM layer (64 hidden units) → Fully connected layer (32-dimensional) → Output layer (4-dimensional, corresponding to wave spectral density) Spectral peak frequency Spectral peak period Spectral width )"; with mixed training datasets For the input, set the loss function to root mean square error (RMSE, Equation 8), and the optimizer to Adam (initial learning rate). Iterate training until the RMSE on the validation set no longer decreases, and you obtain the base model. .
[0067] RMSE calculation formula:
[0068] (8);
[0069] in, For the first The true wave spectrum parameter values of each sample These are the model's predicted values. This represents the number of samples.
[0070] Dataset The dataset is divided into a training set (7350 sets) and a validation set (3150 sets) in a 7:3 ratio. The data is then input into the base model for training. After the first round of training, the training set... Validation set After 50 iterations, , Continue iterating for 10 more rounds until the RMSE on the validation set stabilizes at around 0.35 and stops decreasing. Then stop training and save the base model. .at this time The prediction error for wave spectral density under normal sea conditions is The prediction error for the spectral peak period in extreme sea states is This meets the initial accuracy requirements.
[0071] S32: Set a sliding window and construct an incremental training dataset: Set the sliding window duration to 30 days (determined based on the rate of change of the Donghai Port topography). Construct the incremental training dataset using a "sliding window + real-time acquisition" method—collect real-time wave observation data of Donghai Port every 30 days (obtained from the port's buoy monitoring system, sampling frequency 1 time / hour, totaling 720 data points). After removing outliers, the incremental dataset is formed. ( This refers to the window number, such as the first window being February 1-28, 2023. The second window is from March 1st to 31st, 2023, corresponding to... ).
[0072] From February 1st to 28th, 2023, the buoy monitoring system collected 720 real-time data points. Among them, 5 data points were abnormal due to equipment malfunction (wave height > 10m, significantly exceeding the reasonable range). After removing these 5 data points, 715 valid data points were obtained, forming an incremental dataset. From March 1st to 31st, 2023, 744 data points were collected. After removing 3 outliers, 741 valid data points were obtained, forming an incremental dataset. Each incremental dataset contains complete features such as wave height, period, and wave direction, which can be directly used for model updates.
[0073] S33: Introducing a forgetting factor to dynamically adjust the weights of old data: Designing a forgetting factor Used to reduce old data (such as datasets) The impact of the 2022 data on the model update is calculated using formula (9):
[0074] (9);
[0075] in, The attenuation coefficient (set in this embodiment) ), For the current training time, The old data collection time; in incremental training, the weight of the old data is... New data (such as) The weight of the 2023 data was set to 1 to ensure that the model focuses more on learning the features of the latest data.
[0076] During training in March 2023, old data from August 2022 was processed. (months ≈ 210 days), substituting into formula (9) yields the forgetting factor. The weight of the old data was adjusted from 1 to 0.12; while the incremental data from February 2023... ( (month ≈ 30 days) The weight was adjusted to 0.74; incremental data from March 2023. ( ), The weights are kept at 1. In this way, the model focuses more on learning the new data from 2023 during training, adapting to the wave patterns after the terrain changes.
[0077] S34: Deploy the Bayesian optimizer and adjust hyperparameters in real time: Deploy the Bayesian optimizer to adjust hyperparameters based on the "base model". The prediction error (RMSE) serves as a feedback signal – the real-time calculation model's response to the latest observation data. ,like Compared to the initial value An increase of more than 10% (i.e.) Then the Bayesian optimizer in the hyperparameter space ( The number of hidden units in the LSTM. For learning rate, Search for the optimal hyperparameters within the batch size. and update the model hyperparameters; if If so, the hyperparameters remain unchanged.
[0078] April 2023, basic model Prediction of real-time data The increase from the initial value of 0.35 is This triggers Bayesian optimization; the optimizer operates in the hyperparameter space. The optimal combination of hyperparameters is found through 50 inner iterations. After updating the model hyperparameters, the prediction... The value dropped to 0.36, returning to a reasonable range. From this, we can see that the Bayesian optimizer requires no manual intervention and has a response time of only 1 hour, far faster than the 24 hours required for manual adjustments.
[0079] S35: Build a performance monitoring module to trigger model refactoring: Build a performance monitoring module to monitor the model's prediction error in real time. If 3 times in a row (preset number of times) )of All exceeded the threshold (Right now , , If the model is deemed unsuitable for the current environment, a "model reconstruction process" is triggered—the model is retrained based on the latest "old data (weighted) + all incremental datasets," optimizing the network structure (e.g., increasing the number of convolutional layers) and parameters to obtain a new base model. , to replace the original model.
[0080] In August 2023, Donghai Port experienced a heavy rainfall, which accelerated the siltation and caused significant changes in the terrain slope. Model predictions for real-time data from August 10-12 , , Exceeding 3 times in a row The threshold triggers the model reconstruction process, using "2022 data (weighted) + - Using the incremental data from January to July 2023 as the training set, the number of CNN layers in the original model was increased from 2 to 3, and the model was retrained for 50 epochs to obtain the new model. ; Prediction It dropped to 0.33 and remained stable over the next three months, with the accuracy decay rate controlled to within 1% per month.
[0081] Based on existing technology, we know that the publicly available documents have proposed an "online update method for ocean prediction models". This method has two key drawbacks: First, it does not introduce a forgetting factor (Formula 9). The old data and the new data have the same weight, which leads to the old data continuously interfering with the model after the terrain changes, with an accuracy decay rate of 3%-5% per month. Second, it relies on manual adjustment of hyperparameters and reconstruction of the model, which has a slow response and high labor costs.
[0082] The key innovation of step S3 lies in two aspects: First, by using the forgetting factor (Formula 9) in S33, the weight of old data is dynamically reduced, controlling the model accuracy decay rate from 3%-5% per month in existing technologies to within 1%; second, by using the Bayesian optimizer in S34, automatic search of hyperparameters is achieved. The response time has been reduced from 24 hours to 1 hour, improving maintenance efficiency by 24 times. Thirdly, through S35 performance monitoring and automatic reconfiguration, manual intervention is avoided, extending the model reconfiguration cycle from the traditional 3 months to 6-12 months, reducing maintenance costs by 60%. Ultimately, within a 12-month operating cycle, the model consistently predicts RMSE between 0.3 and 0.35, and the prediction accuracy under extreme sea conditions has increased from 65% of existing technology to 92%, fully meeting the operational needs of Donghai Port.
[0083] In summary, this invention, through the application of a "machine learning-based port wave spectrum parameterization modeling algorithm" in Donghai Port, achieves three core objectives: first, it solves the data silo problem, improving the quality (measured by signal-to-noise ratio) of the feature matrix after privacy fusion of multi-source data by 25%; second, it addresses the problem of extreme sample scarcity, achieving a high physical consistency rate (indicating a high rate of compliance) among the 2000 generated extreme sample sets. The accuracy of the model in extreme scenarios is improved by 27%, and the accuracy decay of the model is reduced by 98%. Thirdly, the model accuracy decay rate is reduced by 27% over 12 months after dynamic optimization, and maintenance costs are reduced by 60%. Compared with traditional modeling methods, this algorithm reduces the wave spectral density prediction error (Formula 8) by 50% and the spectral peak period prediction error by 40%, providing accurate data support for ship berthing safety, wharf structure maintenance, and typhoon response in Donghai Port, and reducing operational losses caused by inaccurate wave predictions each year.
Claims
1. A machine learning-based parameterized modeling algorithm for port wave spectra, characterized by: Includes the following steps: S1: Construct a federated learning framework to achieve privacy-preserving fusion of multi-source heterogeneous port wave data, specifically including S11 and S12; S11: Each data holder trains a sub-model based on its local port wave data. Each sub-model only shares model parameters with the aggregation node of the federated learning framework and does not share the original data; S12: Set up a homomorphic encrypted feature fusion layer at the aggregation node to encrypt the wave spectrum features output by each sub-model before completing feature aggregation; S2: Deploy generative adversarial networks (GANs) on local nodes within the federated learning framework. Utilize a frequency-domain hierarchical attention mechanism to extract multi-scale energy features of port waves and impose physical constraints on them. Guide the GANs to generate extreme sea state samples that conform to wave dynamics. Combine these samples with the regular samples output from S1 to form a hybrid training dataset. The implementation of the frequency-domain hierarchical attention mechanism includes: constructing a multi-level branch structure containing high-frequency, mid-frequency, and low-frequency branches. Port wave data is decomposed into high-frequency wind and wave features, mid-frequency mixed wave features, and low-frequency swell features. The high-frequency branch network uses a convolutional neural network to capture the rapid fluctuation features of high-frequency wind and waves. The mid-frequency branch network uses gated recurrent units to learn the temporal variation features of mid-frequency mixed waves. The low-frequency branch network uses a long short-term memory network to extract the long-term dependency features of low-frequency swells. Port wave data includes high-frequency wind and wave frequencies. ,cycle Mid-frequency mixed waves , Low-frequency swell , Furthermore, a wave energy conservation constraint module is embedded in the generator of the generative adversarial network. The implementation of the wave energy conservation constraint module includes the following steps: S23: Calculate the spectral integral value of the generated sample, which is the energy integral result of the generated sample in the full frequency range; S24: Obtain the effective wave height calculation value corresponding to the generated sample, and calculate the square value of the effective wave height according to the wave dynamics formula; S25: Compare the deviation between the spectral integral value and the square value of the effective wave height. If the deviation exceeds the preset range, the generator parameter fine-tuning is triggered until the deviation meets the preset range. S3: Train a parameterized basic model of the port wave spectrum based on a hybrid training dataset. The input of the basic model is the hybrid training dataset, and the output of the basic model is the corresponding wave spectral density. Spectral peak frequency Spectral peak period Spectral width Furthermore, the basic model is updated online through a dynamic parameter adaptive optimization mechanism, ultimately outputting an accurate port wave spectrum parameterized model.
2. The port wave spectrum parameterization modeling algorithm based on machine learning as described in claim 1, characterized in that: S1 also includes S13: Constructing a contribution evaluation mechanism at the aggregation node, dynamically adjusting the weights of the corresponding sub-model parameters in the global feature matrix based on the sample quality and completeness of the data provided by each data holder.
3. The port wave spectrum parameterization modeling algorithm based on machine learning as described in claim 1, characterized in that: The S2 specifically also The steps include: S21: Set up a cross-scale attention layer at the output of each branch network, calculate the mutual information value between features of different branches, allocate feature weights according to the mutual information value, and fuse them to form a multi-scale energy feature matrix; S2 2: Use the discriminator of a generative adversarial network to compare the generated samples with real extreme sea state samples, and iteratively optimize the generator parameters until the generated samples meet the preset physical consistency criteria.
4. The port wave spectrum parameterization modeling algorithm based on machine learning as described in claim 1, characterized in that: S12 specifically includes the following steps: S121: Encrypt the wave spectrum feature vectors output by each sub-model using a partially homomorphic encryption algorithm to generate encrypted feature vectors; S122: Perform element-wise weighted summation on the encrypted feature vectors at the aggregation node; S123: Decrypt the encrypted result after weighted summation to obtain the global feature matrix.
5. The port wave spectrum parameterization modeling algorithm based on machine learning as described in claim 3, characterized in that: S22 specifically includes the following steps: S221: Input the generated sample and the real extreme sea state sample into the discriminator respectively, and the discriminator outputs the authenticity score of the sample; S222: Calculate the difference between the authenticity score of the generated sample and the preset target score to obtain the generation error; S223: Backpropagate the generation error to the generator and adjust the network parameters of the generator through the gradient descent algorithm; S224: Repeat the process from S221 to S223 until the generation error is less than the preset threshold.
6. The port wave spectrum parameterization modeling algorithm based on machine learning as described in claim 1, characterized in that: The S3 specifically The process includes the following steps: S31: Train a basic parameterized model of port wave spectrum based on a mixed training dataset to determine the initial network structure and parameters of the basic model; S32: Set a fixed-duration sliding window and collect real-time port wave observation data periodically to construct an incremental training dataset; S33: Introduce a forgetting factor during incremental training to dynamically reduce the weight of old data in the incremental training dataset based on the data collection time; S34: Deploy a Bayesian optimizer to monitor the prediction error of the basic model in real time and automatically adjust the model's hyperparameters based on error changes; S35: Build a performance monitoring module that triggers a model reconstruction process when the prediction error of the model exceeds a threshold for a preset number of consecutive times, re-optimizes the model structure and parameters based on the incremental training dataset, and finally outputs an accurate parameterized model of port wave spectrum.
Citation Information
Patent Citations
Prediction method and system for significant wave height of wave of full harbor basin, storage medium and application
CN114519311A
Helicopter anomaly detection method based on unsupervised double-domain model
CN120197003A