Lightweight sea wave area forecast optimization method and system based on multi-task learning
By employing a multi-task learning and feature-sharing mechanism, the problems of missing external propagation information and large input data volume in wave forecasting are solved, enabling high-precision and lightweight forecasting under complex sea conditions and improving the accuracy and computational efficiency of wave forecasting.
Patent Information
- Application Number
- CN202511438539.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-10-10
AI Technical Summary
Existing wave forecasting methods suffer from problems such as lack of external propagation information, large input data volume and difficulty in acquisition, and a contradiction between accuracy and lightweight design, making it difficult to meet the accuracy and stability requirements of practical applications under complex sea conditions.
A multi-task learning framework is adopted, which introduces data from the target sea area and the background sea area during the training phase by sharing the encoder, sharing features and relying only on the target sea area data during the forecasting phase, thus constructing a lightweight wave forecasting model. Convolutional operations are used to achieve parameter sharing between sea area tasks of different scales.
Without increasing computational overhead, it significantly improves the accuracy and physical plausibility of wave forecasts, reduces the amount of input data and computational complexity, and achieves efficient and lightweight forecasting.
Smart Images

Figure CN120910568A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of marine environment prediction, and particularly relates to a lightweight sea wave regional prediction optimization method and system based on multi-task learning. BACKGROUND
[0002] Sea waves are an important part of the marine dynamic environment, and their spatio-temporal evolution has an important influence on maritime navigation safety, near-shore disaster prevention and mitigation, and marine engineering facility stability. Currently, sea wave prediction mainly relies on two types of technical routes: One type is the numerical model method based on physical mechanisms, such as WAVEWATCH III, SWAN, etc. This type of method establishes control equations based on physical processes such as wind wave generation, nonlinear interaction, wave propagation and dissipation, and obtains the evolution results of the wave field through numerical solution. This method can well explain the physical mechanism, but has the disadvantages of large computational overhead, high dependence on the accuracy of external forcing field, and insufficient real-time performance.
[0003] The other type is the data-driven deep learning method. In recent years, convolutional neural networks, recurrent neural networks and hybrid structures have been applied to sea wave element prediction tasks, trying to train the wave evolution law through historical data. This type of method has the advantages of fast reasoning speed and low computational cost, and is suitable for fast prediction and regionalization scenarios, gradually becoming an important supplement to numerical models.
[0004] Existing lightweight sea wave regional prediction methods mainly focus on the following categories: (1) Directly based on target sea area data for model training; this type of method mainly takes the target prediction area as the research object, uses the historical data of the area to construct training samples, and uses deep learning structures such as convolutional neural networks and recurrent neural networks to directly establish the mapping relationship between input meteorological elements and output wave elements without considering the propagation of external environmental information. For example, wind speed and wave elements are used as input features to predict the significant wave height field at the future time through neural network regression.
[0005] (2) Introducing external data of the target sea area for model prediction; this type of method aims to reflect the external environmental influence in the case of single-region training, and attempts to introduce background field information in a larger range as input. Specifically, wind field and wave field data in adjacent sea areas or even larger scales outside the target prediction area are included as model input, in an attempt to explicitly introduce external propagation and energy input processes at the data-driven level. This method expands the data coverage range in the input stage, increasing the amount of input data and model parameters, and reducing the model prediction efficiency.
[0006] (3) Model prediction based on shallow network structure: This method mainly focuses on the optimization of deep learning model in inference efficiency and resource consumption. In order to realize the lightweight target, the research designs the shallow network structure, reduces the parameter size and calculation complexity of the model, and sacrifices the model accuracy to ensure the fast inference speed and low calculation cost, realizes the fast prediction of significant wave height and other wave elements, and is convenient for deployment and application in actual business.
[0007] Through the above analysis, the problems and defects of the prior art are: (1) Missing external propagation information: The deep learning method based on target area training only relies on the historical data of the target sea area for modeling, ignoring the influence of external wave propagation on the energy input of the target sea area through the propagation process, which leads to insufficient description of the target sea area outside the wave propagation, thereby affecting the accuracy of the prediction result.
[0008] (2) Large amount of input data and difficulty in obtaining: Although the prediction method based on expanding the initial background field attempts to introduce more external environmental information, it brings a significant increase in input data dimension, increases the model calculation cost, and weakens the lightweight advantage; at the same time, the external large-scale high-precision background data is often difficult to obtain in actual application, which increases the application cost and difficulty of the method.
[0009] (3) Precision and lightweight contradiction: The prediction method based on lightweight structure design often sacrifices the description ability of the wave physical propagation characteristics while pursuing the reduction of model parameter quantity and calculation quantity; in complex sea conditions or extreme event conditions, the prediction accuracy of this method decreases significantly, which is difficult to meet the dual requirements of precision and stability in actual application. SUMMARY
[0010] In order to overcome the problems in the related art, the embodiment of the present application provides a lightweight sea wave regional prediction optimization method and system based on multi-task learning, and the technical solution is as follows: The present application is realized in this way, the lightweight sea wave regional prediction optimization method based on multi-task learning, comprising the following steps: S1, training data set construction: obtaining the historical spatio-temporal sequence data of the target sea area and the background sea area, and performing splicing processing, respectively constructing the input and output data sets of the target sea area and the background sea area; S2, multi-task model training: input the target sea area and the background sea area input data into the shared encoder for feature extraction to obtain shared features; input the shared features into the main task decoder and the auxiliary task decoder respectively to output the prediction results of the target sea area and the background sea area; calculate the first loss of the target sea area prediction result and the true value, the second loss of the background sea area prediction result and the true value, add the first loss and the second loss to obtain the total loss, and update the parameters of the shared encoder, the main task decoder and the auxiliary task decoder according to the total loss; S3, model prediction: directly input the data required for predicting the target sea area into the fixed shared encoder after training to obtain shared features; input the shared features into the trained main task decoder to obtain the final prediction result of the target sea area; wherein the auxiliary task decoder does not participate in the calculation in the prediction stage.
[0011] In step S1, the historical spatio-temporal sequence data of the target sea area and the background sea area are obtained and spliced, including: obtaining the target sea area meridional wind speed data , the target sea area zonal wind speed data , the target sea area wave height data , the background sea area wind speed data , the background sea area zonal wind speed data , the background sea area wave height data , wherein, is the start time of the data, is the end time of the data, is the start and end time of the data; splicing the wind speed data and the wave height data of the target sea area and the background sea area respectively to obtain the spliced data of the target sea area and the spliced data of the background sea area ; wherein the wind speed and wave height data are from the ERA5 reanalysis dataset of ECMWF, and the time resolution is 1 hour; the splicing processing is performed in the channel dimension to form a three-channel spatio-temporal data matrix of meridional wind speed, zonal wind speed and wave height.
[0012] In step S1, the training data set is divided into target sea area input data, target sea area output data, and background sea area input data and background sea area output data; When the model inputs the current time data to predict the future time data, the target sea area input data set is , is the start and end time of the target sea area input data set; the target sea area output data set is , is the start and end time of the target sea area output data set; the background sea area input data set is , start time of the input data set of the background sea area; the output data set of the background sea area is , start time of the output data set of the background sea area; wherein, is the current time of the input data, is the future time of the prediction result.
[0013] In step S2, the construction of the shared encoder includes: The shared encoder is constructed, the input data of the target sea area is , the input data of the background sea area is , and the encoder parameters are shared between the target sea area prediction task and the background sea area prediction task through a convolutional layer ; The shared encoder is composed of three two-dimensional convolutional layers and ReLU activation functions connected in turn, and the parameters thereof are optimized by the target sea area task and the background sea area task in the training process.
[0014] In step S2, in the decoder, the main task decoder maintains the original model structure, focuses on the extraction of local features, and does not share parameters with the background sea area; the auxiliary task decoder adopts a 1×1 convolutional layer for linear transformation, adjusts the number of channels on the basis of sharing features, and realizes the output meeting the prediction requirements; the expression is: ; ; In the formula, is the target sea area prediction result output by the main task decoder, is the background sea area prediction result output by the auxiliary task decoder, is the model structure of the main task decoder, is an activation function, is the input data of the target sea area, is the shared encoder parameter, is the input data of the background sea area, is the independent parameter of the main task decoder, is the 1×1 convolution kernel parameter of the auxiliary task decoder, and the symbol is a convolution operation.
[0015] In step S2, the first loss and the second loss are added to obtain the total loss, including: The prediction losses of the target sea area and the background sea area are calculated respectively and added as the final total loss function; the loss is used for back propagation to realize multi-task iterative training; the expression is: ; ; ; wherein, is a total loss of model training, is a target sea area training loss, is a background sea area training loss, is a total number of training set samples, is a target sea area real value, is a target sea area prediction result output by a main task decoder, is a background sea area real value, is a background sea area prediction result output by an auxiliary task decoder.
[0016] In step S3, the data required for target sea area prediction is directly input into the fixed shared encoder after training to obtain shared features; including: The historical wind speed and wave height data required for target sea area prediction are obtained, and data preprocessing is performed through data merging operation to input the prediction required data matrix into the model; The input data of the target sea area in the prediction stage is The input data is sent into the shared encoder, and the fixed shared parameters are used to extract features to obtain high-level representations containing background sea area propagation information.
[0017] In step S3, the shared features are only input into the trained main task decoder to obtain the final prediction result of the target sea area, including: The shared features are input into the main task decoder, and the target sea area prediction task is retained; in the prediction stage, the decoder loads the model file containing only the target sea area branch parameters to ensure that the forward propagation calculation in the decoder only executes the path of the main task decoder, and does not allocate any calculation resources to the 1x1 convolution layer of the background sea area branch; the prediction result of the target sea area is output to realize a simple and lightweight prediction process without additional introduction of background sea area data and branch operation; the expression is: ; wherein, is a prediction result of the target sea area model in the prediction stage, is a main task decoder parameter.
[0018] The method further includes verification of the prediction accuracy of the sea wave prediction model; The mean absolute percentage error MAPE, root mean square error RMSE and correlation coefficient are used to calculate the errors of the target sea area real value and the prediction value; ; ; ; In the formula, is the total number of training set samples, is the true value and the predicted value of the wave height of the first sample, is the average value of the true value of the wave height.
[0019] Another object of the present application is to provide a lightweight sea wave area prediction optimization system based on multi-task learning, which is used for regulating and controlling the lightweight sea wave area prediction optimization method based on multi-task learning. The training data set construction module is used for acquiring historical spatio-temporal sequence data of the target sea area and the background sea area and performing splicing processing, and constructing input and output data sets of the target sea area and the background sea area respectively. The multi-task model training module is used for inputting the input data of the target sea area and the background sea area into a shared encoder for feature extraction to obtain shared features; and inputting the shared features into a main task decoder and an auxiliary task decoder respectively to output prediction results of the target sea area and the background sea area. The first loss of the prediction result of the target sea area and the true value, and the second loss of the prediction result of the background sea area and the true value are calculated, the first loss and the second loss are added to obtain a total loss, and the parameters of the shared encoder, the main task decoder and the auxiliary task decoder are updated in reverse according to the total loss. The model prediction module is used for inputting data required for predicting the target sea area into the fixed shared encoder after training to obtain shared features; and inputting the shared features only into the trained main task decoder to obtain the final prediction result of the target sea area, wherein the auxiliary task decoder does not participate in calculation in the prediction stage.
[0020] In combination with all the above technical solutions, the present application has the following beneficial effects: Firstly, the significant wave height area prediction optimization method provided by the present application is based on a multi-task learning framework, and under the premise of maintaining the independent inference ability of the original prediction task, environmental data outside the target prediction sea area is introduced, and the characteristics of convolution operation are utilized to realize convolution parameter sharing between different scale sea area tasks, thereby improving the modeling ability of the model to the wave propagation characteristics. Through this method, the prediction accuracy of the significant wave height can be improved under the condition of the same data input and model parameter amount in the prediction stage.
[0021] For a country near the west coast of the sea, the present application inputs the current 6 hours of wind speed, wave height data in the model, and forecasts the wave height in the future 12 hours; the baseline model uses the conventional convolutional neural network (CNN) for prediction, the RMSE of the model for the 12th hour prediction is 0.742m, the MAPE is 9.68%, R 2 =0.787; after using the optimization method of the present application, the RMSE of the model for the 12th hour prediction is 0.671m, the MAPE is 8.35%, R 2 =0.835. The experimental results show that the present application uses the same input data, model structure and parameter quantity as the baseline model in the prediction process, and obtains better prediction effect.
[0022] Secondly, the significant wave height area prediction optimization method provided by the present application can simultaneously learn the wave characteristics of the target sea area and the background sea area in the training stage through multi-task learning and convolution feature sharing mechanism, which significantly improves the description ability of the model to the wave propagation process. Compared with the existing single-area training method, the present application can more accurately reflect the influence of external waves on the target sea area, improve the prediction accuracy and physical rationality of the significant wave height.
[0023] In the prediction stage, the present application only needs to input the data of the target sea area to complete the prediction, without using the data of the background sea area, thereby significantly reducing the input data amount and calculation complexity, and realizing the lightweight prediction. The design improves the calculation efficiency and the feasibility of model deployment under the premise of ensuring high precision, and is convenient for rapid application in actual marine prediction business.
[0024] Thirdly, the existing regionalized lightweight sea wave prediction method either ignores the external propagation information or relies on a large range of input data and loses the lightweight advantage, and always lacks an effective scheme that can consider the background propagation information and still maintain lightweight reasoning. The present application provides a new technical path for regionalized lightweight sea wave prediction through multi-task learning and shared feature mechanism. In regionalized sea wave prediction, how to simultaneously consider the modeling of propagation information and lightweight reasoning has always been a difficult problem to break through. The present application realizes the effective solution to the contradiction by jointly modeling the target and background sea areas in the training stage and relying only on the target area data in the prediction stage, thereby achieving a breakthrough balance between precision and efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0025] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure; Figure 1 is a lightweight sea wave regional prediction optimization method flowchart provided by the embodiment of the present application; Figure 2 is a model structure diagram in the training stage provided by the embodiment of the present application; Figure 3 This is a structural diagram of the forecasting stage model provided in an embodiment of the present invention; Figure 4 This is a comparison chart of MAPE forecasts from the baseline model and the optimized model under different forecast durations provided in this embodiment of the invention; Figure 5 This is a baseline model diagram of the sea area predicted in the 12th hour using the baseline model and optimized model provided in this embodiment of the invention; Figure 6 This is a map of the optimized sea area forecast for the 12th hour provided by the baseline model and optimized model in this embodiment of the invention. Detailed Implementation
[0026] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0027] The innovation of this invention lies in the following: This invention introduces external propagation information during the training phase through a multi-task learning and feature-sharing mechanism, and achieves lightweight inference by relying solely on the target area forecast branch and data during the forecast phase. This significantly improves the accuracy of regional wave forecasts without increasing computational overhead. This invention introduces a background sea area for model training and achieves parameter sharing between the target and background sea areas through a shared encoder. This allows the target sea area forecast task to learn the broader wave propagation characteristics contained in the background sea area, improving its ability to model wave propagation processes. Simultaneously, the main task decoder maintains the target sea area's learning of its own local characteristics, enabling the model to consider both large-scale wave propagation patterns and the specific characteristics of the target sea area, thereby improving the forecast accuracy of the wave forecast model.
[0028] This invention only requires input of the target sea area data needed for forecasting to perform wave forecasting for the target sea area, without the need to introduce additional background sea area data and related calculations. This effectively reduces the computational complexity and data dependence in the forecasting stage, and realizes lightweight forecasting of the wave forecasting model.
[0029] Example 1, as Figure 1 As shown, the lightweight wave region forecasting optimization method based on multi-task learning provided in this embodiment of the invention includes the following steps: S1, Training dataset construction: Obtain historical spatiotemporal sequence data of the target sea area and the background sea area, and perform splicing processing to construct the input and output datasets of the target sea area and the background sea area respectively; (1) Data collection: obtain meridional wind speed data , zonal wind speed data , wave height data , and background sea area wind speed data , zonal wind speed data , wave height data , wherein, is the start time of the data, is the end time of the data, is the start and end time of the data; (2) Data splicing: in order to ensure that the model simultaneously inputs wind speed and wave height data for training, the wind speed data and wave height data of the target sea area and the background sea area are spliced respectively to obtain spliced data of the target sea area and spliced data of the background sea area . Wherein, the wind speed and wave height data come from the ERA5 reanalysis dataset of ECMWF, and the time resolution is 1 hour; the splicing processing is carried out in the channel dimension to form a three-channel spatio-temporal data matrix of meridional wind speed, zonal wind speed and wave height.
[0030] (3) Dataset making: the dataset is divided into four parts: target sea area input data, target sea area output data, background sea area input data, and background sea area output data. When the model inputs current time data to predict future time data, the target sea area input dataset is , is the start and end time of the target sea area input dataset; the target sea area output dataset is , is the start and end time of the target sea area output dataset; the background sea area input dataset is , is the start and end time of the background sea area input dataset; the background sea area output dataset is , is the start and end time of the background sea area output dataset; wherein, is the number of current time of input data, is the number of future time of prediction result.
[0031] The present application makes training datasets for the target sea area and its surrounding external background sea area respectively, which contain meteorological elements, historical wave elements and other input characteristics and corresponding significant wave and other output wave parameters; by constructing the dataset of the target small sea area and the background large sea area respectively, it provides basic data support for subsequent multi-task training.
[0032] S2, multi-task model training: input the target sea area and the background sea area input data into the shared encoder for feature extraction to obtain shared features; input the shared features into the main task decoder and the auxiliary task decoder respectively to output the prediction results of the target sea area and the background sea area; The advantage of the present application is that any model can be optimized to obtain higher precision prediction results. The present application can be CNN, Transformer, U-Net, etc.
[0033] Firstly, a shared encoder is constructed to realize the module parameter sharing of the target sea area prediction task and the background sea area prediction task; then, a decoder is constructed, the different task parameters of the decoder are independent of each other, the main task decoder uses the original model for prediction, and the auxiliary task decoder uses a 1x1 convolution layer to output the prediction result; finally, the training loss of the target sea area prediction task and the background sea area prediction task is added as the final model loss for back propagation, which specifically includes: (1) constructing a shared encoder: the target sea area input data is , the background sea area input data is , the encoder parameters are shared between the target sea area prediction task and the background sea area prediction task through a convolution layer , so that the target sea area can learn more extensive wave propagation characteristics in the background sea area, thereby enhancing the modeling ability of the model for the wave propagation process. The shared encoder is composed of three two-dimensional convolution layers and ReLU activation functions connected in turn, and the parameters thereof are optimized by the target sea area task and the background sea area task during the training process.
[0034] (2) constructing a decoder: in the decoder, the main task decoder maintains the original model structure, focuses on the extraction of local features, avoids information loss caused by excessive sharing, and does not share parameters with the background sea area. The auxiliary task decoder adopts a 1x1 convolution layer for linear transformation, adjusts the number of channels on the basis of maintaining the shared features, and realizes the output meeting the prediction requirements.
[0035] ; ; In the formula, is the target sea area prediction result output by the main task decoder, is the background sea area prediction result output by the auxiliary task decoder, is the model structure of the main task decoder, is an activation function, is the target sea area input data, is the shared encoder parameter, is the background sea area input data, independent parameters of the main task decoder, 1x1 convolution kernel parameters of the auxiliary task decoder, symbol for a convolution operation.
[0036] (3) Construct a loss function: calculate the first loss of the target sea area prediction result output by the main task decoder and the true value, and the second loss of the background sea area prediction result output by the auxiliary task decoder and the true value, and add them together as the final total loss function. Use the loss for back propagation to realize multi-task iterative training.
[0037] ; ; ; In the formula, total loss of model training, target sea area training loss, background sea area training loss, total number of training set samples, target sea area true value, target sea area prediction result output by the main task decoder, background sea area true value, background sea area prediction result output by the auxiliary task decoder.
[0038] As shown in Figure 2 , the model structure is divided into two parts of shared encoder and decoder. Among them, the shared encoder shares the encoder parameters between the size sea area tasks through the convolution layer, so that the target sea area prediction task can learn the more extensive wave propagation characteristics contained in the background sea area, thereby enhancing the modeling ability of the wave propagation process. In the decoder, the main task decoder maintains the original model structure and no longer shares network parameters with the auxiliary task decoder, so that it can focus on its own unique local features and avoid feature loss caused by excessive sharing; the auxiliary task decoder realizes simple linear transformation through 1x1 convolution to adjust the number of data channels while maintaining the integrity of the shared encoder features, ensuring that the output dimension is consistent with the demand of target sea area prediction. In the training process, mean square error (MSE) is used as the loss function to calculate the prediction loss of the target sea area and the background sea area respectively, and the sum of the two is taken as the total loss function to coordinate the joint optimization of the encoder and the decoder.
[0039] S3, model prediction: directly input the data required for target sea area prediction into the fixed shared encoder after training to obtain shared features; input the shared features only into the trained main task decoder to obtain the final prediction result of the target sea area; wherein the auxiliary task decoder does not participate in the calculation in the prediction stage.
[0040] First, input the data required for target sea area prediction; then, input the data to obtain high-level representations containing background sea area propagation information using fixed shared parameters in the training stage; then, input the shared features into the main task decoder to reserve the target sea area prediction task to generate prediction output, complete the prediction of the target sea area, and realize the simplification and lightweight of the prediction process without additional introduction of background sea area data and branch operation, which specifically includes: (1) Input the data required for prediction: obtain the historical wind speed and wave height data required for target sea area prediction, and perform data preprocessing such as data merging to input the data matrix required for prediction into the model; (2) Shared feature extraction: the input data of the target sea area in the prediction stage is , which is sent to the shared encoder to extract features using fixed shared parameters in the training stage to obtain high-level representations containing background sea area propagation information.
[0041] (3) Decoder prediction: input the shared features into the main task decoder to reserve the target sea area prediction task; in the prediction stage, the decoder loads a model file containing only target sea area branch parameters to ensure that the forward propagation calculation in the decoder only executes the path of the main task decoder and does not allocate any computing resources to the 1x1 convolutional layer of the background sea area branch; output the prediction result of the target sea area to realize a simple and lightweight prediction process without additional introduction of background sea area data and branch operation; the expression is: ; wherein is the prediction result of the target sea area model in the prediction stage, is the main task decoder parameter.
[0042] As shown in Figure 3 , the model prediction stage reserves the prediction task of the target sea area. At this time, the input data only includes the wind speed field, historical wave, and other data required for prediction of the target sea area. The input data is first extracted by the shared encoder to obtain high-level representations containing background sea area propagation information using shared parameters learned and fixed in the training stage; then, the representations are processed by the main task decoder to obtain the prediction output corresponding to the target sea area. The prediction process does not require additional introduction of background sea area data and branch operation, ensuring the simplicity and lightweight of the prediction stage.
[0043] S4, model prediction accuracy verification.
[0044] Based on the true value of the target sea area, the accuracy of the target sea area prediction result is verified using the mean absolute percentage error (MAPE), root mean square error (RMSE), and correlation coefficient (R). error evaluation indexes, such as mean absolute percentage error (MAPE), root mean square error (RMSE) and correlation coefficient (R), to verify the optimization effect of the sea wave prediction model.
[0045] The present application uses three error evaluation indexes, such as mean absolute percentage error (MAPE), root mean square error (RMSE) and correlation coefficient (R), to calculate the error between the real value and the predicted value of the target sea area.
[0046] ; ; ; In the formula, is the total number of training set samples, is the real value and the predicted value of the wave height of the i-th sample, respectively, is the average value of the real value of the wave height.
[0047] The present application evaluates the prediction results of the trained model in the target sea area, uses mean absolute percentage error (MAPE), root mean square error (RMSE) and correlation coefficient (R) and other indexes to verify the effect of the present application method in maintaining light weight while improving the significant wave height prediction accuracy.
[0048] In embodiment 2, the light-weight sea wave area prediction optimization system based on multi-task learning provided by the present application comprises: A training data set construction module is used to obtain the historical spatio-temporal sequence data of the target sea area and the background sea area and perform splicing processing, and input-output data sets of the target sea area and the background sea area are constructed respectively; A multi-task model training module is used to input the input data of the target sea area and the background sea area into a shared encoder for feature extraction to obtain shared features; the shared features are input into a main task decoder and an auxiliary task decoder respectively, and the prediction results of the target sea area and the background sea area are output respectively; The first loss of the target sea area prediction result and the real value and the second loss of the background sea area prediction result and the real value are calculated, the first loss and the second loss are added to obtain the total loss, and the parameters of the shared encoder, the main task decoder and the auxiliary task decoder are updated in reverse according to the total loss; A model prediction module is used to input the data required for target sea area prediction into the fixed shared encoder after training to obtain shared features; the shared features are only input into the trained main task decoder to obtain the final prediction result of the target sea area, and the auxiliary task decoder does not participate in the calculation in the prediction stage.
[0049] To further prove the positive effect of the above-mentioned embodiments, the present application based on the above technical solutions carries out the following experiments.
[0050] The comparison results of the benchmark model prediction error and the prediction error of the model optimization method proposed in the present application are as follows: For a sea area near the west coast of a certain country, the model inputs the current 6-hour wind speed and wave height data to predict the wave height in the next 12 hours. The benchmark model uses a conventional convolutional neural network (CNN) for prediction, and the RMSE of the 12th hour prediction of the model is 0.742 m, the MAPE is 9.68%, and the R 2 is 0.787; after using the optimization method of the present application, the RMSE of the 12th hour prediction of the model is 0.671 m, the MAPE is 8.35%, and the R 2 is 0.835. The present application uses the same input data, model structure and parameter quantity as the benchmark model in the prediction process, and obtains better prediction results. The specific optimization effects are shown in Figure 4 、 Figure 5 、 Figure 6 and Table 1.
[0051] Table 1: Error results of benchmark model and optimized model under each prediction length
[0052] The above describes only the preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any modification, equivalent replacement and improvement made by those skilled in the art within the technical range disclosed in the present application, as long as it is within the spirit and principles of the present application, should be covered within the protection scope of the present application.
Claims
1. A lightweight sea wave area prediction optimization method based on multi-task learning, characterized in that, The method The method comprises the following steps: S1, training dataset construction: obtaining historical spatio-temporal sequence data of the target sea area and the background sea area, and performing splicing processing to construct input and output datasets of the target sea area and the background sea area respectively; S2, multi-task model training: inputting the input data of the target sea area and the background sea area into a shared encoder for feature extraction to obtain shared features; inputting the shared features into a main task decoder and an auxiliary task decoder respectively to output prediction results of the target sea area and the background sea area respectively; calculating a first loss of the prediction result of the target sea area and a true value, a second loss of the prediction result of the background sea area and the true value, adding the first loss and the second loss to obtain a total loss, and updating parameters of the shared encoder, the main task decoder and the auxiliary task decoder reversely according to the total loss; S3, model prediction: directly inputting data required for target sea area prediction into the fixed shared encoder after training to obtain shared features; inputting the shared features only into the trained main task decoder to obtain the final prediction result of the target sea area; wherein the auxiliary task decoder does not participate in calculation in the prediction stage.
2. The multi-task learning-based lightweight sea wave area prediction optimization method according to claim 1, wherein In step S1, the historical spatio-temporal sequence data of the target sea area and the background sea area are obtained, and splicing processing is performed, including: acquiring meridional wind speed data of a target sea area acquiring zonal wind speed data of a target sea area acquiring wave height data of a target sea area acquiring background sea area wind speed data acquiring zonal wind speed data of a target sea area acquiring wave height data of a target sea area wherein, is a start time of the data, is an end time of the data, is a start and end time of the data; The wind speed data and wave height data of the target sea area and the background sea area are stitched together to obtain the stitched data of the target sea area. and background sea area stitched data The wind speed and wave height data are derived from the ECMWF ERA5 reanalysis dataset, with a time resolution of 1 hour. The stitching process is performed along the channel dimension to form a three-channel spatiotemporal data matrix of meridional wind speed, zonal wind speed, and wave height.
3. The multi-task learning based lightweight sea wave area prediction optimization method according to claim 2, characterized in that, In step S1, the training dataset is divided into target sea area input data, target sea area output data, and background sea area input data and background sea area output data; When the model inputs current moment data to predict future moment data, the target sea area input data set is , the start and end time of the target sea area input data set; The target sea area output data set is , The start and end times of the target sea area output data set are , The start and end times of the background sea area input data set are The background sea area output data set is , is the start and end time of the background sea area output data set; wherein, is the current time number of the input data, is the future time number of the prediction result.
4. The multi-task learning-based lightweight sea wave area prediction optimization method according to claim 1, wherein In step S2, the construction of the shared encoder includes: A shared encoder is constructed, target sea area input data is , background sea area input data is , and the encoder parameters are shared between the target sea area prediction task and the background sea area prediction task through a convolutional layer ; The shared encoder is composed of three two-dimensional convolution layers and ReLU activation functions connected in sequence, and the parameters thereof are optimized by the target sea area task and the background sea area task in the training process.
5. The multi-task learning based lightweight sea wave area prediction optimization method according to claim 1, wherein In step S2, in the decoder, the main task decoder maintains the original model structure and focuses on the extraction of local features, and does not share parameters with the background sea area; the auxiliary task decoder adopts a 1x1 convolution layer for linear transformation, adjusts the number of channels on the basis of maintaining the shared features, and realizes the output meeting the prediction requirements; the expression is: ; ; In the formula, is the target sea area prediction result output by the main task decoder, is the background sea area prediction result output by the auxiliary task decoder, is the model structure of the main task decoder, is the activation function, is the target sea area input data, is the shared encoder parameter, is the background sea area input data, is the independent parameter of the main task decoder, is the 1x1 convolution kernel parameter of the auxiliary task decoder, and the symbol is the convolution operation.
6. The multi-task learning based lightweight sea wave area prediction optimization method according to claim 1, characterized in that, In step S2, the first loss and the second loss are added to obtain the total loss, including: The prediction losses of the target sea area and the background sea area are calculated respectively and added as the final total loss function; the loss is used for back propagation to realize multi-task iterative training; the expression is: ; ; ; In the formula, is a total loss of model training, is a target sea area training loss, is a background sea area training loss, is a total number of training set samples, is a target sea area true value, is a target sea area prediction result output by the main task decoder, is a background sea area true value, is a background sea area prediction result output by the auxiliary task decoder.
7. The multi-task learning based lightweight sea wave area prediction optimization method according to claim 5, characterized in that, In step S3, the data required for target sea area prediction is directly inputted into the fixed shared encoder after training to obtain shared features; including: Obtaining historical wind speed and wave height data required for target sea area prediction, and performing data preprocessing through data merging operation to input the data matrix required for model prediction; Input data for the target sea area during the forecast phase are: Input data The data is fed into a shared encoder, utilizing shared parameters fixed during the training phase. Features are extracted to obtain a high-level representation that includes background marine propagation information.
8. The multi-task learning based lightweight sea wave area prediction optimization method according to claim 7, characterized in that, In step S3, the shared features are only inputted into the trained main task decoder to obtain the final prediction result of the target sea area, including: The shared feature is input into the main task decoder, and the target sea area prediction task is reserved; in the prediction stage, the decoder loads a model file containing only the target sea area branch parameters, ensuring that the forward propagation calculation in the decoder only performs the pass of the main task decoder and does not allocate any computing resources to the 1×1 convolutional layer of the background sea area branch; the prediction result of the target sea area is output, realizing a simple and lightweight prediction process without the need to additionally introduce background sea area data and branch operation; the expression is: ; In the formula, is the prediction result of the target sea area model in the prediction stage, is the main task decoder parameter.
9. The multi-task learning based lightweight sea wave area prediction optimization method according to claim 1, characterized in that, The method further comprises sea wave prediction model prediction accuracy verification; The mean absolute percentage error MAPE, the root mean square error RMSE and the correlation coefficient The three error evaluation indexes calculate the error of the real value and the predicted value of the target sea area. ; ; ; In the formula, This represents the total number of samples in the training set. The first The true and predicted values of wave height for each sample. This represents the average of the true wave height values.
10. A lightweight sea wave area prediction optimization system based on multi-task learning, characterized by, The system is used for regulating and controlling the lightweight sea wave area prediction optimization method based on multi-task learning according to any one of claims 1-9, and the system comprises: A training data set construction module is configured to obtain historical spatio-temporal sequence data of the target sea area and the background sea area and perform splicing processing, and construct input and output data sets of the target sea area and the background sea area, respectively. A multi-task model training module is configured to input the input data of the target sea area and the background sea area into a shared encoder for feature extraction to obtain shared features; input the shared features into a main task decoder and an auxiliary task decoder, respectively, to output prediction results of the target sea area and the background sea area, respectively. A first loss of the target sea area prediction result and the true value and a second loss of the background sea area prediction result and the true value are calculated, the first loss and the second loss are added to obtain a total loss, and the parameters of the shared encoder, the main task decoder and the auxiliary task decoder are updated in reverse according to the total loss. A model prediction module is configured to input data required for target sea area prediction into a fixed shared encoder after training to obtain shared features; input the shared features only into the trained main task decoder to obtain the final prediction result of the target sea area, wherein the auxiliary task decoder does not participate in the calculation in the prediction stage.
Citation Information
Patent Citations
A method for detecting wave height from a near-shore sea wave video based on a convolutional neural network
CN109886217A
Sea wave height prediction and model training method, electronic equipment and storage medium
CN115660041A
Sea wave significant wave height intelligent prediction and error correction method and system based on 2D-Geoform
CN119128392A
Near-shore sea wave forecasting method and system based on deep learning
CN119720804A
Ocean weather forecasting system
WO2020131187A2