Ocean state variable prediction method based on thermocline adaptive loss
By designing a marine state variable forecasting method based on the thermoclimb adaptive loss, the problem of insufficient thermoclimb forecasting accuracy and stability in the prior art is solved, and a more efficient thermoclimb forecasting effect is achieved.
Patent Information
- Application Number
- CN202510179782.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-02-19
AI Technical Summary
The prior art is difficult to accurately capture its complex physical processes and severe temperature change characteristics in thermoclimb forecasting, resulting in large forecast errors, and the traditional loss function cannot effectively adapt to temperature changes in the thermoclimb area, resulting in poor results in learning and simulating the complex evolution process of the thermoclimb.
A marine state variable forecasting method based on thermoclimb adaptive loss was designed, and the ocean forecast model was constructed through a deep learning framework, and the thermoclimb adaptive mechanism was introduced in the loss function design. Through normalization processing and weighting error mechanism, the weight of the loss function was dynamically adjusted to highlight the importance of the thermoclimb region.
The accuracy and stability of thermoclimb prediction are significantly improved, and the model can learn and simulate the complex evolution process of thermoclimb more accurately, reducing the forecast error by about 50%, and improving the robustness and adaptability of the model.
Smart Images

Figure CN119646459B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of marine meteorology, and in particular, relates to a method for predicting marine state variables based on thermocline adaptive loss. Background Art
[0002] The thermocline is a transition layer in the ocean where the temperature changes dramatically with depth, usually located in the depth range of 100-500 meters. It plays a vital role in ocean dynamics and climate systems, and has a profound impact on ocean mixing, heat exchange, biological productivity, and atmospheric processes. Accurate prediction of the thermocline is of great significance to the fields of marine scientific research, marine resource development, climate change monitoring, and marine disaster warning.
[0003] Traditional ocean forecast models are mainly based on numerical methods, such as numerical forecast models (GOFSs), including the Mercator Ocean Physical System (PSY4) and the Real-Time Ocean Forecast System (RTOFS). These models describe the future motion of the ocean by solving partial differential equations of geodynamics. However, numerical forecast models have some obvious shortcomings in thermocline forecasting: first, when dealing with temperature gradient changes in the thermocline region, numerical models often find it difficult to accurately capture its complex physical processes and drastic temperature change characteristics, resulting in large forecast errors; second, the computational overhead of numerical models is huge, and in the process of simulating the dynamic evolution of the thermocline, they are easily affected by initial conditions and boundary conditions, further exacerbating the uncertainty of the forecast.
[0004] With the rapid development of artificial intelligence technology, data-driven artificial intelligence ocean forecasting models have gradually emerged, providing new ideas and methods for ocean forecasting. However, existing artificial intelligence ocean forecasting models still face many challenges in thermocline forecasting. Especially in the design of loss functions, traditional loss functions such as mean square error (MSE) or mean absolute error (MAE) cannot fully adapt to the severity and complexity of temperature changes in the thermocline region, give the same weight to temperature changes in all regions, and cannot highlight the importance of the thermocline region, resulting in poor results in the model when learning and simulating the complex evolution of the thermocline. The temperature gradient in the thermocline region changes dramatically, and the requirements for forecast accuracy are extremely high. However, traditional loss functions cannot effectively guide the model to conduct refined learning of the thermocline region, making it difficult to capture the temperature gradient change characteristics of the thermocline, and the forecast accuracy and stability are insufficient.
[0005] In addition, the formation and evolution of the thermocline are affected by many factors, including internal ocean dynamics, atmospheric forcing, seasonal changes, etc. These factors make the thermocline behave differently in different sea areas, seasons, and under the influence of different ocean dynamics. When dealing with such complex and changeable thermocline characteristics, the existing artificial intelligence models are unable to accurately predict and adapt to the thermocline under different circumstances due to the limitations of the loss function, which further limits their effectiveness and value in practical applications. Summary of the invention
[0006] The purpose of the present invention is to provide a method for predicting ocean state variables based on thermocline adaptive loss, so as to improve the accuracy and reliability of thermocline prediction, thereby making up for the shortcomings of the prior art.
[0007] To achieve the above object, the present invention is achieved through the following technical solutions:
[0008] A method for predicting ocean state variables based on thermocline adaptive loss, the method comprising the following steps:
[0009] S1: Collect ocean state variable data and perform preprocessing;
[0010] S2: Building an ocean forecast model based on a deep learning framework, the input of the model is the ocean state variable data preprocessed by S1, and the output of the model is the ocean state variable data for the next day;
[0011] S3: Designing a loss function of the ocean forecast model: a thermocline adaptive loss function;
[0012] S4: training the ocean forecast model, and performing evaluation and optimization;
[0013] S5: Use the trained ocean forecast model to forecast ocean state variables.
[0014] Furthermore, in S1: collect ocean reanalysis data (you can choose the GLORYS12 reanalysis data set from the Copernicus Ocean Database), including ocean state variables such as temperature, salinity, and current velocity, to ensure that the data covers the depth range of the thermocline, with a temporal resolution of 1 day, a horizontal spatial resolution of 1 / 12°, and 50 depth layers in the vertical direction (0 m, 10 m, 20 m, 30 m, 40 m, 50 m, 60 m, 70 m, 80 m, 90 m, 100 m, 150 m, 200 m, 250 m, 300 m, 350 m, 400 m, 450 m, 500 m, 550 m, 600 m, 650 m, 700 m, 750 m, 800 m, 850 m, 900 m, 1000 m, 1100 m, The present invention selects 32 depth layers above 500 m to completely cover the depth range of 100-500 m where the thermocline is located; the preprocessing comprises: scaling the data of each variable and each depth layer to between 0 and 1 by using mean variance normalization, eliminating the dimensional differences between different variables, and providing a unified data basis for subsequent model training and loss function calculation.
[0015] Furthermore, in S2, the deep learning framework can be a convolutional neural network (CNN), a recurrent neural network (RNN), a Transformer, a TransformerV2, etc.; the ocean state variable data input by the model is in the form of [channel, longitude, latitude], and the size is [128, 4320, 2040], where 128 is a combination of 32 depth layer temperatures, salinity, east-west components of ocean current velocity, and north-south components of ocean current velocity, 4320 is 4320 longitude grids with a resolution of 1 / 12°, and 2040 is 2040 latitude grids with a resolution of 1 / 12°; the output of the model is the ocean data of the next day in the same organizational form and size. The model is responsible for learning the spatiotemporal characteristics and evolution laws of ocean state variables from the input data, and providing basic prediction results for the forecast of ocean state variables in the next day.
[0016] Furthermore, in S3, according to the severity and complexity of the temperature change in the thermocline region, a thermocline adaptive loss function is designed, and the adaptive mechanism is realized in the following way: first, the temperature data in the thermocline region is normalized so that its value range is between 0 and 1; then, the absolute error between the model prediction value and the true value is calculated, and the error is weighted by the normalized temperature data, so that the error weight in the thermocline region is larger, thereby guiding the model to pay more attention to the temperature change characteristics of the thermocline. The specific formula is:
[0017] ;
[0018] in Represents the grid channel where the temperature and salinity in X are located, Represents the grid coordinates of longitude, latitude, and depth respectively. Norm represents scaling the data to the range of 0-1 by normalizing the maximum and minimum values. and The distribution represents the corresponding true value in the reanalysis data set and the predicted value based on the thermocline adaptive loss method. This loss makes the model pay more attention to the area with large vertical gradient, especially the temperature change characteristics near the thermocline, thereby significantly improving the model's learning effect on the complex evolution of the thermocline. The overall training loss function based on the thermocline adaptive loss method is defined as:
[0019] ;
[0020] Wherein λ is an empirical parameter, and λ=1 in the present invention. is the true value of the reanalysis data at time t, is the predicted value of the model at time t.
[0021] Furthermore, in S4, the preprocessed data is used for model training, and the model parameters are updated by the optimization algorithm, so that the model continuously reduces the value of the thermocline adaptive loss function during the training process, and improves the model's prediction ability for the thermocline area. An independent test data set is used to evaluate the trained model, and the evaluation indicators include root mean square error (RMSE), mean absolute error (MAE), peak signal-to-noise ratio (PSNR), etc. By evaluating the performance of the model in thermocline prediction, the deficiencies of the model are found, and the model structure and parameters are further optimized according to the evaluation results to achieve better prediction results.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] The adaptive thermocline loss function designed by the present invention can dynamically adjust the weight of the loss function according to the severity and complexity of the temperature change in the thermocline region. This adaptive mechanism allows the model to pay more attention to the temperature gradient change characteristics of the thermocline region during the training process, thereby guiding the model to more accurately learn and simulate the complex evolution process of the thermocline. Specifically, the adaptive thermocline loss function normalizes the temperature data in the thermocline region, calculates the absolute error between the model prediction value and the true value, and then weights the error according to the normalized temperature data, so that the error weight in the thermocline region is larger. This improvement enables the model to focus more on the temperature change characteristics of the thermocline, effectively improving the accuracy and stability of the thermocline forecast. Compared with the prior art, the traditional loss function gives the same weight to the temperature changes in all regions, and cannot highlight the importance of the thermocline region, resulting in poor results in the model when learning and simulating the complex evolution process of the thermocline, and insufficient forecast accuracy and stability; the present invention overcomes this limitation by adaptively adjusting the weights, and significantly improves the performance of the thermocline forecast.
[0024] It has been verified in practice that the present invention significantly improves the accuracy and stability of thermocline prediction, while simplifying the model training process, providing a more efficient and reliable thermocline prediction tool for marine scientific research and practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is the overall flow chart of the present invention.
[0026] Figure 2 This is a comparison chart of the results using the modified thermocline adaptive loss and the general loss.
[0027] Figure 3 This is a comparison chart between the thermocline adaptive loss method and other traditional methods. DETAILED DESCRIPTION
[0028] The technical solution of the present invention is further described below in conjunction with embodiments.
[0029] After analyzing the shortcomings of existing ocean forecasting models in thermocline forecasting, it was found that both traditional numerical models and AI models have certain limitations. It is difficult for numerical models to accurately capture the complex physical processes and drastic temperature change characteristics of the thermocline. Although AI models have advantages in data-driven, the traditional loss functions they use cannot effectively adapt to the drastic and complex temperature changes in the thermocline region. These loss functions give the same weight to temperature changes in all regions and fail to highlight the importance of the thermocline region, resulting in poor results in the model's learning and simulation of the complex evolution of the thermocline, and insufficient forecast accuracy and stability.
[0030] In order to solve this problem, the following embodiment proposes a thermocline adaptive loss function. The loss function aims to enhance the model's learning ability of the thermocline region through optimization design, so that the model can more accurately capture the temperature gradient change characteristics of the thermocline. By adaptively adjusting the weight of the loss function, the importance of the thermocline region is highlighted, and the model is guided to focus more on learning the complex evolution process of the thermocline during training, thereby significantly improving the accuracy and reliability of thermocline forecasts.
[0031] Embodiment 1:
[0032] Assume that the thermocline forecast for the first day in the future needs to be made based on the ocean state variables on November 3, 2023. The forecast task process is as follows: Figure 1 As shown:
[0033] S110 Data Collection and Preprocessing
[0034] First, the GLORYS12 reanalysis data of November 3, 2023 is obtained from the Copernicus Ocean Database, including ocean state variables such as temperature, salinity, and current velocity. The data covers the depth range of 100-500 meters where the thermocline is located, with a time resolution of 1 day, a horizontal spatial resolution of 1 / 12°, and is divided into 50 depth layers vertically. This embodiment uses 32 depth layers above 500 meters. The data of each variable and each depth layer are then normalized by mean variance, scaled to between 0-1, and the dimensional differences between different variables are eliminated, providing a unified data basis for subsequent model training and loss function calculation. For example, for the temperature variable, its mean and variance are calculated at each depth layer, and the temperature value of each grid point is subtracted from the mean and divided by the variance to obtain the normalized temperature data.
[0035] S120 Model Building
[0036] The model can use any deep learning framework, such as convolutional neural network (CNN), recurrent neural network (RNN), Transformer, TransformerV2, etc. This embodiment takes TransformerV2 as an example to construct an ocean forecast model. The TransformerV2 model structure in the example includes the following key components: (1) Input layer: The input size is [128, 4320, 2040], where 128 represents the combination of ocean state variables (temperature, salinity, east-west component of ocean current velocity, north-south component of ocean current velocity) at 32 depth layers, 4320 represents 4320 longitude grids at 1 / 12° resolution, and 2040 represents 2040 latitude grids at 1 / 12° resolution. This input layer accepts the ocean data processed in step S110 and provides a data basis for subsequent model training. (2) Downsampling layer: It includes 3 downsampling layers, each with a transformer operation with a window size of 5, 10, and a node number of 768. The purpose of the downsampling layer is to gradually reduce the spatial resolution, extract key features from the input data, and enhance the model's ability to capture local and global patterns of ocean data. (3) Upsampling layer: It is followed by three upsampling layers with window sizes of 5 and 10 and 768 nodes. The upsampling layer is used to restore the spatial resolution of the data, ensuring that the output layer can be restored to the same spatial dimension as the input layer, thereby accurately predicting the future ocean state. (4) Output layer: The output size is [128, 4320, 2040], which is consistent with the size of the input layer, representing the prediction results of the ocean state variables for the next 7 days. The prediction data generated by this output layer includes temperature, salinity, east-west component of ocean current velocity, north-south component of ocean current velocity, etc. The structure is consistent with the input data, ensuring that the prediction results can be directly compared and analyzed with the original data. The model provides basic prediction results for thermocline forecasting by learning the spatiotemporal characteristics and evolution laws in the input data.
[0037] Design and application of adaptive loss function for S130 thermocline
[0038] According to the severity and complexity of the temperature change in the thermocline region, the thermocline adaptive loss function is designed. During the training process, the temperature data in the thermocline region is normalized so that its value range is between 0 and 1; then the absolute error between the model prediction value and the true value is calculated, and the error is weighted by the normalized temperature data, so that the error weight in the thermocline region is larger. The specific formula is:
[0039] ;
[0040] in Represents the grid channel where the temperature and salinity in X are located, Represents the grid coordinates of longitude, latitude, and depth respectively. Norm represents scaling the data to the range of 0-1 by normalizing the maximum and minimum values. and The distribution represents the corresponding true value in the reanalysis dataset and the predicted value based on the thermocline adaptive loss method. This loss makes the model pay more attention to the areas with large vertical gradients, especially the temperature change characteristics near the thermocline, thereby significantly improving the model's learning effect on the complex evolution of the thermocline. Based on the above loss definition, the overall training loss based on the thermocline adaptive loss method is defined as:
[0041] ;
[0042] The thermocline adaptive loss function can dynamically adjust the weights according to the temperature gradient changes in the thermocline area, guiding the model to focus more on learning the complex evolution of the thermocline during training, thereby improving the accuracy and stability of thermocline forecasts. The prediction accuracy of the thermocline can be significantly improved by more than 50%, see Figure 1 .
[0043] S140 Model Training
[0044] The model is trained using normalized data, and the thermocline adaptive loss function is integrated into the loss calculation of the model during the training process. The model parameters are updated using an optimization algorithm (such as the Adam optimizer) so that the model continuously reduces the value of the thermocline adaptive loss function during the training process, thereby improving the model's ability to predict the thermocline region. During training, an appropriate learning rate (such as 0.001) and training cycle (such as 100 epochs) are set to ensure that the model can fully learn the features and patterns in the data.
[0045] S150 Model Evaluation and Optimization
[0046] An independent test data set is used to evaluate the trained model, and the evaluation indicators include root mean square error (RMSE), mean absolute error (MAE), peak signal-to-noise ratio (PSNR), etc. By evaluating the performance of thermocline forecasting, the deficiencies of the model are found, and the model structure and parameters are further optimized according to the evaluation results to achieve better forecasting results. For example, if the evaluation results show that the model has low accuracy in thermocline forecasting in certain specific areas or seasons, the network structure of the model can be adjusted in a targeted manner, the amount of data in the relevant area can be increased, or the parameters of the optimization algorithm can be adjusted to improve the overall performance of the model.
[0047] Compared with the prior art, the adaptive thermocline loss function of the present invention has achieved significant beneficial effects in thermocline forecasting. Figure 2The forecast results using the adaptive thermocline loss function and the MAE loss function are compared in Figure 2 (the model architecture used is the same, only the loss function is different). Figure 3 The prediction results of the present invention are compared with those of the numerical model (the numerical model prediction results are from the public data organized by GODAE OceanView). Figure 2 and three The true value data comes from the global GLORYS12 (Copernicus Global 1 / 12° Oceanicand Sea Ice Reanalysis) reanalysis data from 1993 to 2018 (for training) and 2019 to 2020 (for evaluation) provided by the French Mercator Océan International (download address: https: / / data.marine.copernicus.eu / product / GLOBAL_MULTIYEAR_PHY_001_030 / services). Figure 2 The two comparison methods in the above are completed by independent training by the inventors. Figure 3 The forecast results of the numerical model are provided by the IV-TT Class 4 framework developed by the GODAE OceanView organization; among them, the four numerical models appearing in the figure are: PSY4 (developed by Mercator Océan, France), BLK (developed by the Institute of Marine Hydrophysics, Russia), GIOPS (developed by the Canadian Ministry of Environment and Climate Change) and FPAM (developed by the Institute of Atmospheric Physics, Chinese Academy of Sciences) (download address: https: / / thredds.nci.org.au / thredds / catalog / rr6 / intercomparison_files / catalog.html). First, the adaptive thermocline loss function of the present invention greatly improves the accuracy of thermocline forecasting. Experimental data show that the model using the adaptive thermocline loss function has significantly reduced the forecast error in the thermocline region, and the root mean square error (RMSE) is reduced by about 50% compared with other methods. This improvement in accuracy means that the model can more accurately capture the temperature gradient change characteristics of the thermocline, providing more reliable data support for marine scientific research.
[0048] The loss function provided by the present invention enhances the robustness of the model. When faced with changes in the thermocline under the influence of different sea areas, different seasons and different ocean dynamic processes, the model can maintain a high forecast stability. Even under complex marine environmental conditions, such as under the influence of strong sea-air interaction or disturbances of internal ocean dynamic processes, the adaptive thermocline loss function can still effectively guide the model to make accurate thermocline forecasts, showing good adaptability and stability.
[0049] In the technical solution created by the present invention, each step is closely connected to form a complete workflow. First, data preprocessing lays the foundation for model construction. Through normalization, the original ocean reanalysis data is converted into a unified format, eliminating the dimensional differences between different variables, so that the model can more accurately learn and understand the characteristics and laws in the data. Then, the ocean forecast model built based on the deep learning framework is trained using preprocessed data. The model architecture and parameter selection determine the calculation method and optimization target of the loss function. The adaptive thermocline loss function plays a key role in the model training process. By dynamically adjusting the weights, the model is guided to focus more on the temperature change characteristics of the thermocline region, optimize the training direction of the model, and continuously improve the accuracy and stability of the thermocline forecast during the training process. After the training is completed, the model evaluation and optimization link tests the model performance, finds the shortcomings of the model through the evaluation indicators, and further optimizes the model structure and parameters according to the evaluation results, so that the accuracy and stability of the model in the thermocline forecast are continuously improved. During the whole process, data preprocessing provides high-quality input data for model construction, model construction provides a platform for the loss function to play a role, the adaptive thermocline loss function optimizes the model training process, and model evaluation and optimization ensure the continuous improvement of model performance, which together promotes the improvement of thermocline forecast accuracy and stability, and provides more accurate forecast support for marine scientific research and practical applications.
[0050] Through the above technical scheme, the present invention can effectively improve the accuracy and reliability of thermocline forecasting and provide more accurate forecasting support for marine scientific research and practical applications.
[0051] Finally, although this specification is described according to implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A method for predicting ocean state variables based on thermocline adaptive loss, characterized in that: The method comprises the following steps: S1: Collect ocean state variable data and perform preprocessing; S2: Building an ocean forecast model based on a deep learning framework, the input of the model is the ocean state variable data preprocessed by S1, and the output of the model is the ocean state variable data for the next day; the deep learning framework includes convolutional neural network CNN, recurrent neural network RNN, Transformer, and TransformerV2; S3: Design the loss function of the ocean forecast model: thermocline adaptive loss function; normalize the temperature data in the thermocline region so that its value range is between 0 and 1; then, calculate the absolute error between the model forecast value and the true value, and weight the error by the normalized temperature data so that the error weight in the thermocline region is larger. The specific formula is: Where [X ST ] represents the grid channel where the temperature and salinity in X are located, 0<x<W, 0<y<H, 0<z<C ST Represents the grid coordinates of longitude, latitude and depth respectively. Norm represents scaling the data to the range of 0-1 by normalizing the maximum and minimum values. and The distribution represents the corresponding true value in the reanalysis dataset and the predicted value based on the thermocline adaptive loss method. The overall training loss function based on the thermocline adaptive loss method is defined as: Where λ is an empirical parameter, is the true value of the reanalysis data at time t, is the predicted value of the model at time t; S4: training the ocean forecast model, and performing evaluation and optimization; S5: Use the trained ocean forecast model to forecast ocean state variables.
2. The method for predicting ocean state variables according to claim 1, characterized in that: In S1: collect ocean reanalysis data including temperature, salinity, and current velocity, ensure that the data covers the depth range where the thermocline is located, the time resolution is 1 day, the horizontal spatial resolution is 1 / 12°, and the vertical depth is divided into 50 layers.
3. The ocean state variable prediction method according to claim 1, characterized in that: The preprocessing in S1 is: scaling the data of each variable and each depth layer to between 0 and 1 by using mean variance normalization to eliminate the dimensional differences between different variables.
4. The method for predicting ocean state variables according to claim 1, characterized in that: In S2, the ocean state variable data input by the model is in the form of [channel, longitude, latitude] and of size [128, 4320, 2040], where 128 is a combination of 32 depth layer temperatures, salinity, east-west components of ocean current velocity, and north-south components of ocean current velocity, 4320 is 4320 longitude grids with a resolution of 1 / 12°, and 2040 is 2040 latitude grids with a resolution of 1 / 12°; the output of the model is ocean data for the next day in the same organizational form and size.
5. The ocean state variable prediction method according to claim 1, characterized in that: In S4, the preprocessed data is used to train the model and the model parameters are updated so that the model continuously reduces the value of the thermocline adaptive loss function during the training process, thereby improving the model's prediction ability for the thermocline region; an independent test data set is used to evaluate the trained model, and the evaluation indicators include root mean square error RMSE, mean absolute error MAE, and peak signal-to-noise ratio PSNR.
Citation Information
Patent Citations
Ocean three-dimensional temperature and salt field space-time forecasting method, device, equipment and medium
CN117787136A