A method and system for predicting marine weather based on neural network

By combining cloud images and wave timing data, the problem of insufficient accuracy and robustness of marine weather prediction in the existing technology is solved, and a higher accuracy and robustness of marine weather prediction is achieved, and marine cage farming is supported. decision making for activities.

CN118962852BActive Publication Date: 2025-01-14SHENZHEN HENGYUAN ZHIDA TECHNOLOGY TRANSFER CENTER CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411434961.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-14
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

The existing marine weather forecasting methods rely on a single data source, with low prediction accuracy and robustness, making it difficult to meet the demand for fine weather forecasts of marine cage farming.

Method used

Using a neural network-based marine weather prediction method, combining data sources with time and space, cloud image data and wave timing data are used to predict weather. Features are extracted and feature fusion is performed through YOLOv8 and LSTM neural network models to construct marine weather Prediction model to improve prediction accuracy and robustness.

Benefits of technology

It achieves higher weather forecasting accuracy and robustness, can fully describe weather conditions in specific areas of the ocean, reduce the intensity of manual analysis, and provide real-time weather warning support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118962852B_ABST
    Figure CN118962852B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for predicting marine weather based on a neural network, the method comprising: obtaining cloud image data sets and wave time series data sets within several historical time periods in a specific marine area, saving them together as historical data sets and preprocessing them; building a marine weather prediction model; training the marine weather prediction model using the preprocessed historical data sets; finally obtaining real-time cloud image data and wave time series data of the specific marine area and inputting them into the trained marine weather prediction model for prediction, thereby obtaining real-time weather prediction results; the present invention has comprehensive data sources, combines data sources in two dimensions of time and space, performs weather prediction based on cloud image data and wave time series data, and can comprehensively describe the weather conditions in a specific marine area; at the same time, the neural network model is trained based on more comprehensive data, and the trained model has higher accuracy in weather recognition and prediction, and is more robust.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence and ocean weather forecasting, and more specifically, to an ocean weather forecasting method and system based on a neural network. Background Art

[0002] Marine aquaculture is an important aquaculture industry, providing humans with a large amount of aquatic products such as fish and shellfish. Marine cage aquaculture is one of the most widely used aquaculture methods. The environmental conditions of cage aquaculture have a significant impact on the growth and survival rate of aquaculture species, among which weather conditions are one of the most critical environmental factors. Traditional weather forecasting methods mainly rely on data collection and manual analysis from meteorological stations, which have defects such as limited coverage and low accuracy, and are difficult to meet the refined weather forecasting needs of marine cage aquaculture.

[0003] With the development of deep learning and artificial intelligence technology, people gradually apply them to the field of marine weather forecasting. For example, the existing patent documents disclose a weather forecasting method and system based on deep learning, which includes: S1, saving the collected historical weather data and real-time weather data; S2, establishing a layer-by-layer deep learning model based on the weather data and continuously correcting the deep learning model; S3, synchronizing the collected real-time weather data to the deep learning model; S4, obtaining the output result based on the deep learning model after importing the real-time weather data; However, the method in the prior art only relies on a single data source for prediction, and has the defects of low prediction accuracy and robustness. Summary of the invention

[0004] In order to overcome the defects of low prediction accuracy and robustness in the above-mentioned prior art, the present invention provides a marine weather prediction method and system based on neural network, which combines data sources in two dimensions of time and space, and performs weather prediction based on cloud image data and wave time series data, with higher prediction accuracy and greater robustness.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] A method for predicting ocean weather based on a neural network comprises the following steps:

[0007] S1: Obtain cloud image datasets and wave time series datasets in a specific ocean area within several historical periods, save them together as a historical dataset, and preprocess the historical dataset;

[0008] S2: Build a marine weather forecast model;

[0009] The marine weather prediction model comprises: an input layer, an image feature extraction module and a time series feature extraction module arranged in parallel, a feature fusion module and an output layer;

[0010] The input layer is used to input cloud image data and ocean wave time series data;

[0011] The image feature extraction module is used to extract features of cloud image data and obtain cloud image features;

[0012] The time series feature extraction module is used to extract the features of the ocean wave time series data and obtain the ocean wave time series features;

[0013] The feature fusion module is used to fuse cloud image features and wave time series features to obtain fusion features;

[0014] The output layer is used to output weather forecast results according to the fusion features;

[0015] S3: Using the preprocessed historical data set to train the ocean weather prediction model to obtain a trained ocean weather prediction model;

[0016] S4: Obtain real-time cloud image data and wave time series data of a specific ocean area and input them into a trained ocean weather prediction model for prediction to obtain real-time weather forecast results.

[0017] Preferably, in step S1, cloud images of a specific ocean area captured by a camera in several historical periods are collected, and the cloud type of each cloud image is annotated to obtain a cloud image dataset;

[0018] The cloud types include: cirrus, stratocumulus and cumulonimbus;

[0019] Collect wave data measured by wave meters in a specific ocean area over several historical periods, and use the wave data to calculate a wave time series data set;

[0020] The wave data includes: wave height, wave period and wavelength data of the sea waves.

[0021] Preferably, the method of calculating the ocean wave time series data set using the wave data comprises the following steps:

[0022] The intermediate effective wave height is calculated using the wave height, wave period and wavelength data of the ocean waves, specifically:

[0023]

[0024] Among them, Heff is the effective wave height, in meters; H is the wave height data, in meters; T is the wave period data, in seconds; L is the wavelength data, in meters; To find the square root function;

[0025] The Douglas sea state grade formula is used to obtain the mapped sea state code C, which is:

[0026]

[0027] Wherein, C is the sea surface status code;

[0028] Different sea surface state code C values ​​correspond to different sea surface state descriptions, specifically:

[0029] C<1: The wave is level 0, indicating that the sea is calm;

[0030] 1≤C<2: The wave is level 1, indicating that the sea surface is rippled;

[0031] 2≤C<3: The wave is level 2, indicating that there are light waves on the sea surface;

[0032] 3≤C<4: The wave is level 3, indicating that there are light to moderate waves on the sea surface;

[0033] 4≤C<5: The wave is level 4, indicating that there are medium waves on the sea surface;

[0034] 5≤C<6: The wave is level 5, indicating that there are heavy and medium waves on the sea surface;

[0035] 6≤C<7: The wave is level 6, indicating heavy waves on the sea surface;

[0036] 7≤C<8: The wave is level 7, indicating high waves on the sea surface;

[0037] C≥8: The wave is level 8, indicating that there are strange waves on the sea surface;

[0038] The sea surface state code C and its corresponding sea surface state description in all historical periods of a specific ocean area are saved together as the wave time series dataset.

[0039] Preferably, in step S1, preprocessing the cloud image dataset includes:

[0040] S101: Data cleaning: Use the statistical method 3σ rule to eliminate abnormal data; use interpolation or smoothing to handle missing data;

[0041] S102: Data standardization: linearly convert data of different dimensions to a unified numerical range of 0~1;

[0042] S103: Data formatting: converting numerical data into tensor format and image data into matrix format to meet the input requirements of the neural network;

[0043] The preprocessing of the wave time series dataset includes:

[0044] S111: Data standardization: The wave time series data set is processed using the Z-score standardization method. The processed wave time series data set follows a standard normal distribution with a mean of 0 and a standard deviation of 1.

[0045] S112: Detect and process outliers: The outliers are extreme values ​​that deviate from the normal distribution range of the data. For the wave time series data set, a quantile-based method is used to detect and process outliers, specifically:

[0046] In the wave time series data set, the 25% quantile of all data is recorded as Q1, and the 75% quantile of all data is recorded as Q3, then the interquartile range IQR satisfies: IQR=Q3-Q1;

[0047] If a wave time series data x satisfies: or , then the wave time series data x is regarded as an outlier;

[0048] For detected outliers, directly remove them or use data interpolation methods to repair them;

[0049] S113: Processing missing values: For missing values ​​in the wave time series data set, linear interpolation method is used to fill the missing values ​​within the missing interval;

[0050] S114: Use One-Hot encoding to map the data of each time step into a high-dimensional sparse vector.

[0051] Preferably, in step S2, the image feature extraction module is specifically a YOLOv8 neural network model;

[0052] The time series feature extraction module is specifically an LSTM neural network model.

[0053] Preferably, in step S2, the feature fusion module is specifically:

[0054] The ocean wave temporal features output by the LSTM neural network model are spatially expanded to match the spatial dimensions of the cloud image features output by the YOLOv8 neural network model.

[0055] The spatial dimension of the cloud image feature is , the spatial dimension of the wave time series characteristics is , where B is the batch size; C y is the number of channels of the YOLOv8 neural network model; C y ' is the number of channels of the LSTM neural network model; h and w are the height and width of the cloud image features respectively;

[0056] The spatial expansion of the ocean wave time series characteristics is expressed as:

[0057]

[0058] Among them, Y3 is the spatial dimension of the temporal characteristics of the ocean waves after spatial expansion; represents the tensor product, is a matrix of all 1s with dimension h×w;

[0059] The spatially expanded ocean wave temporal features and cloud image features are weighted summed in the channel dimension to obtain the fusion feature F, which is expressed as:

[0060]

[0061] in, and are the weight coefficients of cloud image features and wave time series features, respectively, satisfying ;[;] represents the concatenation operation in the channel dimension.

[0062] Preferably, in step S2, the output layer includes a fully connected layer and a Sigmoid activation layer connected in sequence, and the weather forecast result is specifically a probability prediction value of the occurrence of different weather phenomena.

[0063] Preferably, step S3 comprises:

[0064] Setting the total loss function for supervised ocean weather forecast model training , the total loss function Specifically:

[0065]

[0066] in, is the binary cross entropy loss function; is the target loss function of the YOLOv8 neural network model; is the loss function of the LSTM neural network model; and are the first and second balance coefficients, respectively;

[0067] The loss function of the YOLOv8 neural network model Specifically:

[0068]

[0069] in, is the bounding box regression loss; Loss for the existence or non-existence of the target; is the classification loss; , and They are the third, fourth and fifth balance coefficients respectively;

[0070] The loss function of the LSTM neural network model Specifically:

[0071]

[0072] in, is the mean square error loss; is the regularization term; is the regularization coefficient;

[0073] Using the total loss function Perform end-to-end joint training on the marine weather prediction model, and optimize the parameters of the YOLOv8 neural network model, LSTM neural network model, feature fusion module, and output layer;

[0074] During the training process, stochastic gradient descent and back propagation are used to update parameters. The gradients of the feature fusion module flow to the YOLOv8 neural network model and the LSTM neural network model respectively. The YOLOv8 neural network model and the LSTM neural network model independently receive the gradients and update their parameters.

[0075] The cosine annealing algorithm is used for learning rate scheduling to continuously optimize the training results until the total loss function When the minimum value is obtained, the trained ocean weather forecast model is obtained.

[0076] Preferably, the method further comprises:

[0077] S5: Generate weather warning information for the current and future period based on real-time weather forecast results, and provide users with behavioral decision-making suggestions based on the weather warning information.

[0078] The present invention also provides a marine weather prediction system based on a neural network, which uses the above-mentioned marine weather prediction method based on a neural network, including:

[0079] Preprocessing unit: used to obtain cloud image datasets and wave time series datasets in several historical periods of a specific ocean area, save them together as historical datasets, and preprocess the historical datasets;

[0080] Model building unit: used to build ocean weather prediction models;

[0081] The marine weather prediction model comprises: an input layer, an image feature extraction module and a time series feature extraction module arranged in parallel, a feature fusion module and an output layer;

[0082] The input layer is used to input cloud image data and ocean wave time series data;

[0083] The image feature extraction module is used to extract features of cloud image data and obtain cloud image features;

[0084] The time series feature extraction module is used to extract the features of the ocean wave time series data and obtain the ocean wave time series features;

[0085] The feature fusion module is used to fuse cloud image features and wave time series features to obtain fusion features;

[0086] The output layer is used to output weather forecast results according to the fusion features;

[0087] Model training unit: used to train the ocean weather prediction model using the preprocessed historical data set to obtain a trained ocean weather prediction model;

[0088] Weather forecast unit: used to obtain real-time cloud image data and wave time series data of a specific ocean area and input them into the trained ocean weather forecast model for prediction to obtain real-time weather forecast results.

[0089] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0090] The present invention provides a marine weather prediction method and system based on a neural network. First, cloud image data sets and sea wave time series data sets in several historical periods of a specific marine area are obtained, and the data sets are saved together as a historical data set, and the historical data set is preprocessed; then a marine weather prediction model is constructed; the marine weather prediction model is trained using the preprocessed historical data set to obtain a trained marine weather prediction model; finally, real-time cloud image data and sea wave time series data of the specific marine area are obtained and input into the trained marine weather prediction model for prediction, so as to obtain a real-time weather prediction result;

[0091] The data source of the present invention is comprehensive, combining data sources of both time and space dimensions, and weather forecasting based on cloud image data and wave time series data, which can fully describe the weather conditions in specific ocean areas; at the same time, the neural network model is trained based on more comprehensive data, and the trained model has higher accuracy and more robustness in weather recognition and prediction; in addition, the present invention can realize intelligent forecasting of ocean weather, reduce the workload of manual analysis and decision-making, provide real-time weather warnings based on real-time weather forecast results, and provide decision-making support for other activities such as marine cage aquaculture in combination with weather warnings. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] Figure 1This is a flow chart of a neural network-based ocean weather forecasting method provided in Example 1.

[0093] Figure 2 This is a structural diagram of the ocean weather prediction model provided in Example 2.

[0094] Figure 3 This is a structural diagram of a neural network-based ocean weather forecasting system provided in Example 3. DETAILED DESCRIPTION

[0095] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;

[0096] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;

[0097] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0098] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0099] Example 1

[0100] like Figure 1 As shown, this embodiment provides a method for predicting ocean weather based on a neural network, comprising the following steps:

[0101] S1: Obtain cloud image datasets and wave time series datasets in a specific ocean area within several historical periods, save them together as a historical dataset, and preprocess the historical dataset;

[0102] S2: Build a marine weather forecast model;

[0103] The marine weather prediction model comprises: an input layer, an image feature extraction module and a time series feature extraction module arranged in parallel, a feature fusion module and an output layer;

[0104] The input layer is used to input cloud image data and ocean wave time series data;

[0105] The image feature extraction module is used to extract features of cloud image data and obtain cloud image features;

[0106] The time series feature extraction module is used to extract the features of the ocean wave time series data and obtain the ocean wave time series features;

[0107] The feature fusion module is used to fuse cloud image features and wave time series features to obtain fusion features;

[0108] The output layer is used to output weather forecast results according to the fusion features;

[0109] S3: Using the preprocessed historical data set to train the ocean weather prediction model to obtain a trained ocean weather prediction model;

[0110] S4: Obtain real-time cloud image data and wave time series data of a specific ocean area and input them into a trained ocean weather prediction model for prediction to obtain real-time weather forecast results.

[0111] In the specific implementation process, firstly, cloud image datasets and wave time series datasets in several historical periods of a specific ocean area are obtained, and saved together as a historical dataset, and the historical dataset is preprocessed;

[0112] Then, an ocean weather prediction model is constructed; in this embodiment, the ocean weather prediction model is provided with two branches, which are used to extract features of cloud image data and wave time series data respectively, and then feature fusion is performed to perform weather prediction based on the fused features;

[0113] The preprocessed historical data set is used to train the ocean weather prediction model to obtain the trained ocean weather prediction model;

[0114] Finally, the real-time cloud image data and wave time series data of a specific ocean area are obtained and input into the trained ocean weather prediction model for prediction to obtain real-time weather forecast results;

[0115] This method has comprehensive data sources, combining data sources in both time and space dimensions, and makes weather forecasts based on cloud image data and wave time series data, which can fully describe the weather conditions in specific ocean areas. At the same time, the neural network model is trained based on more comprehensive data, and the trained model has higher accuracy and more robust weather recognition and prediction. In addition, this method can realize intelligent forecasting of ocean weather, reduce the workload of manual analysis and decision-making, provide real-time weather warnings based on real-time weather forecast results, and provide decision-making support for other activities such as marine cage aquaculture in combination with weather warnings.

[0116] Example 2

[0117] This embodiment provides a method for predicting ocean weather based on a neural network, comprising the following steps:

[0118] S1: Obtain cloud image datasets and wave time series datasets in a specific ocean area within several historical periods, save them together as a historical dataset, and preprocess the historical dataset;

[0119] S2: Build a marine weather forecast model;

[0120] The marine weather prediction model comprises: an input layer, an image feature extraction module and a time series feature extraction module arranged in parallel, a feature fusion module and an output layer;

[0121] The input layer is used to input cloud image data and ocean wave time series data;

[0122] The image feature extraction module is used to extract features of cloud image data and obtain cloud image features;

[0123] The time series feature extraction module is used to extract the features of the ocean wave time series data and obtain the ocean wave time series features;

[0124] The feature fusion module is used to fuse cloud image features and wave time series features to obtain fusion features;

[0125] The output layer is used to output weather forecast results according to the fusion features;

[0126] S3: Using the preprocessed historical data set to train the ocean weather prediction model to obtain a trained ocean weather prediction model;

[0127] S4: Obtain real-time cloud image data and wave time series data of a specific ocean area and input them into a trained ocean weather prediction model for prediction to obtain real-time weather forecast results;

[0128] S5: Generate weather warning information for the current and future period based on real-time weather forecast results, and provide users with behavioral decision-making suggestions based on the weather warning information;

[0129] In the step S1, cloud images of a specific ocean area captured by a camera in a number of historical periods are collected, and the cloud type of each cloud image is annotated to obtain a cloud image dataset;

[0130] The cloud types include: cirrus, stratocumulus and cumulonimbus;

[0131] Collect wave data measured by wave meters in a specific ocean area over several historical periods, and use the wave data to calculate a wave time series data set;

[0132] The wave data includes: wave height, wave period and wavelength data of the sea waves;

[0133] The method of calculating the ocean wave time series data set using the wave data comprises the following steps:

[0134] The intermediate effective wave height is calculated using the wave height, wave period and wavelength data of the ocean waves, specifically:

[0135]

[0136] Among them, Heff is the effective wave height, in meters; H is the wave height data, in meters; T is the wave period data, in seconds; L is the wavelength data, in meters; To find the square root function;

[0137] The Douglas sea state grade formula is used to obtain the mapped sea state code C, which is:

[0138]

[0139] Wherein, C is the sea surface status code;

[0140] Different sea surface state code C values ​​correspond to different sea surface state descriptions, specifically:

[0141] C<1: The wave is level 0, indicating that the sea is calm;

[0142] 1≤C<2: The wave is level 1, indicating that the sea surface is rippled;

[0143] 2≤C<3: The wave is level 2, indicating that there are light waves on the sea surface;

[0144] 3≤C<4: The wave is level 3, indicating that there are light to moderate waves on the sea surface;

[0145] 4≤C<5: The wave is level 4, indicating that there are medium waves on the sea surface;

[0146] 5≤C<6: The wave is level 5, indicating that there are heavy and medium waves on the sea surface;

[0147] 6≤C<7: The wave is level 6, indicating heavy waves on the sea surface;

[0148] 7≤C<8: The wave is level 7, indicating high waves on the sea surface;

[0149] C≥8: The wave is level 8, indicating that there are strange waves on the sea surface;

[0150] The sea surface state code C and the corresponding sea surface state description in all historical periods of a specific ocean area are saved together as the wave time series data set;

[0151] In step S1, preprocessing the cloud image dataset includes:

[0152] S101: Data cleaning: Use the statistical method 3σ rule to eliminate abnormal data; use interpolation or smoothing to handle missing data;

[0153] S102: Data standardization: linearly convert data of different dimensions to a unified numerical range of 0~1;

[0154] S103: Data formatting: converting numerical data into tensor format and image data into matrix format to meet the input requirements of the neural network;

[0155] The preprocessing of the wave time series dataset includes:

[0156] S111: Data standardization: The wave time series data set is processed using the Z-score standardization method. The processed wave time series data set follows a standard normal distribution with a mean of 0 and a standard deviation of 1.

[0157] S112: Detect and process outliers: The outliers are extreme values ​​that deviate from the normal distribution range of the data. For the wave time series data set, a quantile-based method is used to detect and process outliers, specifically:

[0158] In the wave time series data set, the 25% quantile of all data is recorded as Q1, and the 75% quantile of all data is recorded as Q3, then the interquartile range IQR satisfies: IQR=Q3-Q1;

[0159] If a wave time series data x satisfies: or , then the wave time series data x is regarded as an outlier;

[0160] For detected outliers, directly remove them or use data interpolation methods to repair them;

[0161] S113: Processing missing values: For missing values ​​in the wave time series data set, linear interpolation method is used to fill the missing values ​​within the missing interval;

[0162] S114: Use One-Hot encoding to map the data of each time step into a high-dimensional sparse vector;

[0163] In step S2, the image feature extraction module is specifically a YOLOv8 neural network model;

[0164] The time series feature extraction module is specifically an LSTM neural network model;

[0165] In step S2, the feature fusion module is specifically:

[0166] The ocean wave temporal features output by the LSTM neural network model are spatially expanded to match the spatial dimensions of the cloud image features output by the YOLOv8 neural network model.

[0167] The spatial dimension of the cloud image feature is , the spatial dimension of the wave time series feature is , where B is the batch size; C yis the number of channels of the YOLOv8 neural network model; C y ' is the number of channels of the LSTM neural network model; h and w are the height and width of the cloud image features respectively;

[0168] The spatial expansion of the ocean wave time series characteristics is expressed as:

[0169]

[0170] Among them, Y3 is the spatial dimension of the temporal characteristics of the ocean waves after spatial expansion; represents the tensor product, is a matrix of all 1s with dimension h×w;

[0171] The spatially expanded ocean wave temporal features and cloud image features are weighted summed in the channel dimension to obtain the fusion feature F, which is expressed as:

[0172]

[0173] in, and are the weight coefficients of cloud image features and wave time series features, respectively, satisfying ;[;] represents the concatenation operation in the channel dimension;

[0174] In step S2, the output layer includes a fully connected layer and a Sigmoid activation layer connected in sequence, and the weather forecast result is specifically a probability prediction value of the occurrence of different weather phenomena;

[0175] The step S3 comprises:

[0176] Setting the total loss function for supervised ocean weather forecast model training , the total loss function Specifically:

[0177]

[0178] in, is the binary cross entropy loss function; is the target loss function of the YOLOv8 neural network model; is the loss function of the LSTM neural network model; and are the first and second balance coefficients, respectively;

[0179] The loss function of the YOLOv8 neural network model Specifically:

[0180]

[0181] in, is the bounding box regression loss; Loss for the existence or non-existence of the target; is the classification loss; , and They are the third, fourth and fifth balance coefficients respectively;

[0182] The loss function of the LSTM neural network model Specifically:

[0183]

[0184] in, is the mean square error loss; is the regularization term; is the regularization coefficient;

[0185] Using the total loss function Perform end-to-end joint training on the marine weather prediction model, and optimize the parameters of the YOLOv8 neural network model, LSTM neural network model, feature fusion module, and output layer;

[0186] During the training process, stochastic gradient descent and back propagation are used to update parameters. The gradients of the feature fusion module flow to the YOLOv8 neural network model and the LSTM neural network model respectively. The YOLOv8 neural network model and the LSTM neural network model independently receive the gradients and update their parameters.

[0187] The cosine annealing algorithm is used for learning rate scheduling to continuously optimize the training results until the total loss function When the minimum value is obtained, the trained ocean weather forecast model is obtained.

[0188] In the specific implementation process, firstly, a cloud image dataset and a wave time series dataset in a certain historical period of a specific ocean area are obtained, and they are saved together as a historical dataset, and the historical dataset is preprocessed; in this embodiment, the weather forecast of the area where the marine cage group is located is used as an example for explanation;

[0189] Specifically, for cloud image data, we first collected cloud images of cage groups taken by cameras in several historical periods, and used the labeling tool LabelImg to label the image data in the YOLO format required by YOLOv8. We labeled the cloud type of each cloud image and obtained a cloud image dataset. The cloud types include cirrus, stratocumulus, and cumulonimbus.

[0190] Then the annotated cloud image data is preprocessed, which mainly includes the following steps:

[0191] 1) Data cleaning: Use the statistical method 3σ rule to eliminate abnormal data; use interpolation or smoothing to handle missing data;

[0192] The 3σ rule is expressed as:

[0193] Let the data set be X = {x1, x2, ..., x n}, its mean is μ, standard deviation is σ, if x i Requirements:

[0194] |x i - μ|>3σ

[0195] are considered as outliers;

[0196] Here, the absolute value symbol is used to represent x i When the absolute difference between x and μ is greater than 3 times the standard deviation σ, i Determined as an outlier;

[0197] 2): Data standardization: linearly convert data of different dimensions to a unified numerical range of 0~1;

[0198] 3): Data formatting: convert numerical data into tensor format and image data into matrix format to meet the input requirements of the neural network;

[0199] The preprocessed cloud image dataset is divided into training set, validation set and test set, and the ratio is set to 7:2:1;

[0200] For the ocean wave time series data, wave data measured by wave meters in the cage group area during several historical periods are collected, and the ocean wave time series data set is calculated using the wave data; the wave data includes: wave height, wave period and wavelength data of the ocean wave;

[0201] The calculation of the wave time series data set using wave data includes the following steps:

[0202] The intermediate effective wave height is calculated using the wave height, wave period and wavelength data of the ocean waves. It takes into account the three factors of wave height, wave period and wavelength, specifically:

[0203]

[0204] Among them, Heff is the effective wave height, in meters; H is the wave height data, in meters; T is the wave period data, in seconds; L is the wavelength data, in meters; To find the square root function;

[0205] The Douglas sea state grade formula is used to obtain the mapped sea state code C, which is:

[0206]

[0207] Wherein, C is the sea surface status code;

[0208] Different sea surface state code C values ​​correspond to different sea surface state descriptions, specifically:

[0209] C<1: The wave is level 0, indicating that the sea is calm;

[0210] 1≤C<2: The wave is level 1, indicating that the sea surface is rippled;

[0211] 2≤C<3: The wave is level 2, indicating that there are light waves on the sea surface;

[0212] 3≤C<4: The wave is level 3, indicating that there are light to moderate waves on the sea surface;

[0213] 4≤C<5: The wave is level 4, indicating that there are medium waves on the sea surface;

[0214] 5≤C<6: The wave is level 5, indicating that there are heavy and medium waves on the sea surface;

[0215] 6≤C<7: The wave is level 6, indicating heavy waves on the sea surface;

[0216] 7≤C<8: The wave is level 7, indicating high waves on the sea surface;

[0217] C≥8: The wave is level 8, indicating that there are strange waves on the sea surface;

[0218] The sea surface state code C and the corresponding sea surface state description in all historical periods of a specific ocean area are saved together as the wave time series data set, and the C value is the wave time series data of the area where the cage group is located at a certain moment;

[0219] The wave time series data is then preprocessed, including the following steps:

[0220] 1) Data standardization: The purpose of standardization is to scale the data into a uniform numerical range, which helps to improve the stability and convergence speed of model training. This embodiment uses the Z-score standardization method to linearly convert data of different dimensions into a uniform numerical range of 0 to 1;

[0221] The formula for Z-score standardization is:

[0222] z = (x - μ) / σ

[0223] Among them, x is the original observation value, μ is the data mean, and σ is the data standard deviation;

[0224] After this step of processing, the data will obey the standard normal distribution with a mean of 0 and a standard deviation of 1;

[0225] 2) Detect and process outliers: Outliers are extreme values ​​that deviate from the normal distribution range of data. For the wave time series dataset, a quantile-based method is used to detect and process outliers, specifically:

[0226] In the wave time series data set, the 25% quantile of all data is recorded as Q1, and the 75% quantile of all data is recorded as Q3, then the interquartile range IQR satisfies: IQR=Q3-Q1;

[0227] If a wave time series data x satisfies: or , then the wave time series data x is regarded as an outlier;

[0228] For detected outliers, directly remove them or use data interpolation methods to repair them;

[0229] 3) Processing missing values: Since there may be missing values ​​in the wave time series data due to instrument failure or other reasons, these missing values ​​are filled in the missing interval by linear interpolation method;

[0230] 4) Vectorized encoding: Since sea surface time series data are usually discrete state values ​​(such as 0 to 8 representing different levels), One-Hot encoding is used to map the data of each time step into a high-dimensional sparse vector; only one position in the vector is 1, and the rest are all 0;

[0231] Assuming that the sea surface state has 9 discrete values ​​(0 to 8), the vector dimension after One-Hot encoding is 9; if the state value is outside the range of 0 to 8, you can consider adding two special values ​​(such as -1 and 9) for encoding;

[0232] Then, an ocean weather prediction model is constructed; in this embodiment, the ocean weather prediction model is provided with two branches, which are used to extract features of cloud image data and wave time series data respectively, and then feature fusion is performed to perform weather prediction based on the fused features;

[0233] like Figure 2 As shown, it is a structure diagram of the marine weather prediction model in this embodiment, wherein the image feature extraction module is specifically a YOLOv8 neural network model; the time series feature extraction module is specifically an LSTM neural network model; the outputs of the two models are input into the output layer after feature fusion, and finally the weather prediction result is output;

[0234] The LSTM network constructed in this embodiment has only one sea surface state value at each time step, and the input dimension is 1; the LSTM network uses multi-layer stacking, and the more layers there are, the stronger the expression ability of the model; the number of LSTM units in each layer is set to 128; in addition, through the LSTM network gating mechanism and cyclic calculation, dynamic time series features are extracted from time series data, long-term dependencies are captured, and time series data are processed; the last hidden layer state of LSTM is used as the final representation of the time series features;

[0235] This embodiment also reshapes the wave time series features output by the LSTM network, adds a fully connected layer, and maps the LSTM final state to the feature dimensions required by YOLOv8;

[0236] In the feature fusion module, the ocean wave temporal features output by the LSTM neural network model are spatially expanded to match the spatial dimensions of the cloud image features output by the YOLOv8 neural network model.

[0237] The spatial dimension of the cloud image feature is , the spatial dimension of the wave time series characteristics is , where B is the batch size; C y is the number of channels of the YOLOv8 neural network model; C y ' is the number of channels of the LSTM neural network model; h and w are the height and width of the cloud image features respectively;

[0238] The spatial expansion of the ocean wave time series characteristics is expressed as:

[0239]

[0240] Among them, Y3 is the spatial dimension of the temporal characteristics of the ocean waves after spatial expansion; represents the tensor product, is a matrix of all 1s with dimension h×w;

[0241] The spatially expanded ocean wave temporal features and cloud image features are weighted summed in the channel dimension to obtain the fusion feature F, which is expressed as:

[0242]

[0243] in, and are weight coefficients of cloud image features and wave time series features respectively. In this embodiment, and are 0.6 and 0.4 respectively; [;] indicates the concatenation operation in the channel dimension;

[0244] The output layer includes a fully connected layer and a Sigmoid activation layer connected in sequence. The fused feature F is passed to the fully connected layer. The output Z of the fully connected layer is expressed as:

[0245]

[0246] Among them, w3 and b are the weight matrix and bias vector of the fully connected layer respectively;

[0247] The i-th output Z of the fully connected layer i After the Sigmoid activation layer, the output Z i Convert to probability values ​​to obtain the probability prediction values ​​of different weather phenomena, expressed as:

[0248] P(y i )=σ(Z i )=1 / (1+e -Zi )

[0249] Among them, y i represents the i-th weather phenomenon, P(y i ) is the probability of its occurrence;

[0250] The preprocessed historical data set is used to train the ocean weather prediction model to obtain the trained ocean weather prediction model;

[0251] Setting the total loss function for supervised ocean weather forecast model training , the total loss function Specifically:

[0252]

[0253] in, is the binary cross entropy loss function; is the target loss function of the YOLOv8 neural network model; is the loss function of the LSTM neural network model; and are the first and second balance coefficients, respectively;

[0254] The loss function of the YOLOv8 neural network model Specifically:

[0255]

[0256] in, is the bounding box regression loss; Loss for the existence or non-existence of the target; is the classification loss; , and They are the third, fourth and fifth balance coefficients respectively;

[0257] The loss function of the LSTM neural network model Specifically:

[0258]

[0259] in, is the mean square error loss, which is used to measure the difference between the predicted value and the true value of the LSTM neural network model; is a regularization term used to prevent overfitting and satisfy , w represents the weight parameter in the LSTM network; is the regularization coefficient, which is used to balance the MSE loss and the regularization term;

[0260] Using the total loss function Perform end-to-end joint training on the marine weather prediction model, and optimize the parameters of the YOLOv8 neural network model, LSTM neural network model, feature fusion module, and output layer;

[0261] For the YOLOv8 network, set the input image resolution to 640×640, set the batch size batch_size=16, set the initial learning rate lr0=0.01, select an appropriate learning rate strategy, set the total training epochs=300; select the data augmentation strategy of data horizontal flipping and color jittering;

[0262] Configure YOLOv8 model hyperparameters, set the number of model layers and channels, and select appropriate anchor priors.

[0263] After the configuration is complete, use the PyTorch deep learning framework to start model training, load the pre-trained model weights as initialization, build a data loader to read the above pre-processed cloud image training set and validation set data, define optimizers SGD and Adam, and perform iterative training; calculate the training loss and validation indicators for each epoch, monitor the training process in real time, and check the convergence of the loss function and the changes in indicators;

[0264] The final model is evaluated on the test set and the precision is calculated. If the precision index is greater than or equal to the preset precision index, the model weight file is saved and the target detection and features of the cloud image are extracted. Otherwise, retraining is performed. The precision is expressed as

[0265] TP / (TP + FP)

[0266] Among them, TP (True Positive) indicates the number of real samples that are positive and are also predicted by the model as positive; FP (False Positive) indicates the number of real samples that are negative but are incorrectly predicted by the model as positive.

[0267] For the LSTM network, the ocean wave time series dataset is used for training;

[0268] During the training process, the stochastic gradient descent method (SGD) and back propagation are used to update the parameters. The stochastic gradient descent method is expressed as:

[0269] θ t+1 =θ t -η·∇L total (θ t )

[0270] Among them, θ represents the model parameters, η is the learning rate, and ∇L total is the gradient of the loss function;

[0271] The gradients of the feature fusion module flow to the YOLOv8 neural network model and the LSTM neural network model respectively. The YOLOv8 neural network model and the LSTM neural network model independently receive the gradients and update their parameters.

[0272] The cosine annealing algorithm is used for learning rate scheduling to continuously optimize the training results, which can be expressed as:

[0273] η t =η min +0.5·(η max -η min )·[1+cos(πt / T)]

[0274] Where t is the current iteration number and T is the total iteration number;

[0275] Until the total loss function When the minimum value is obtained, the trained ocean weather forecast model is obtained;

[0276] Obtain real-time cloud image data and wave time series data of a specific ocean area and input them into the trained ocean weather forecast model for prediction to obtain real-time weather forecast results;

[0277] Finally, weather warning information for the current and future period is generated based on real-time weather forecast results, and behavioral decision-making suggestions are provided to users based on the weather warning information;

[0278] This method has comprehensive data sources, combines data sources in both time and space dimensions, and makes weather forecasts based on cloud image data and wave time series data, which can fully describe the weather conditions in specific ocean areas. At the same time, the neural network model is trained based on more comprehensive data, and the trained model has higher accuracy and more robust weather recognition and forecasting capabilities. In addition, this method can realize intelligent forecasting of ocean weather, reduce the workload of manual analysis and decision-making, and provide real-time weather warnings based on real-time weather forecast results, and provide decision-making support for other activities such as marine cage aquaculture in combination with weather warnings.

[0279] In conclusion, this method can significantly improve the timeliness and accuracy of marine cage weather monitoring and forecasting, provide strong technical support for cage aquaculture, and has important theoretical significance and application value.

[0280] Example 3

[0281] like Figure 3 As shown, this embodiment provides a marine weather prediction system based on a neural network, applying a marine weather prediction method based on a neural network described in Embodiment 1 or 2, including:

[0282] Preprocessing unit 301: used to obtain cloud image datasets and sea wave time series datasets in a certain ocean area within a certain historical period, save them together as a historical dataset, and preprocess the historical dataset;

[0283] Model building unit 302: used to build an ocean weather prediction model;

[0284] The marine weather prediction model comprises: an input layer, an image feature extraction module and a time series feature extraction module arranged in parallel, a feature fusion module and an output layer;

[0285] The input layer is used to input cloud image data and ocean wave time series data;

[0286] The image feature extraction module is used to extract features of cloud image data and obtain cloud image features;

[0287] The time series feature extraction module is used to extract the features of the ocean wave time series data and obtain the ocean wave time series features;

[0288] The feature fusion module is used to fuse cloud image features and wave time series features to obtain fusion features;

[0289] The output layer is used to output weather forecast results according to the fusion features;

[0290] Model training unit 303: used to train the ocean weather prediction model using the preprocessed historical data set to obtain a trained ocean weather prediction model;

[0291] Weather prediction unit 304: used to obtain real-time cloud image data and wave time series data of a specific ocean area and input them into a trained ocean weather prediction model for prediction, thereby obtaining real-time weather prediction results.

[0292] In the specific implementation process, first, the preprocessing unit 301 obtains a cloud image dataset and a wave time series dataset in a certain historical period of a specific ocean area, and saves them together as a historical dataset, and preprocesses the historical dataset;

[0293] Then the model building unit 302 builds an ocean weather prediction model; in this embodiment, the ocean weather prediction model is provided with two branches, which are used to extract the features of the cloud image data and the wave time series data respectively, and then perform feature fusion to perform weather prediction based on the fused features;

[0294] The model training unit 303 trains the ocean weather prediction model using the preprocessed historical data set to obtain a trained ocean weather prediction model;

[0295] Finally, the weather prediction unit 304 obtains the real-time cloud image data and wave time series data of the specific ocean area and inputs them into the trained ocean weather prediction model for prediction, thereby obtaining the real-time weather prediction results;

[0296] This system has comprehensive data sources, combining data sources in both time and space dimensions, and makes weather forecasts based on cloud image data and wave time series data, which can fully describe the weather conditions in specific ocean areas. At the same time, the neural network model is trained based on more comprehensive data, and the trained model has higher accuracy and more robust weather recognition and prediction. In addition, this system can realize intelligent forecasting of ocean weather, which can reduce the workload of manual analysis and decision-making. Based on real-time weather forecast results, it can provide real-time weather warnings, and provide decision-making support for other activities such as marine cage aquaculture in combination with weather warnings.

[0297] The same or similar reference numerals correspond to the same or similar components;

[0298] The terms used in the drawings to describe positional relationships are only used for illustrative purposes and should not be construed as limiting this patent;

[0299] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for predicting marine weather based on a neural network, characterized in that: The following steps are involved: S1: Obtain cloud image datasets and wave time series datasets in a specific ocean area within several historical periods, save them together as a historical dataset, and preprocess the historical dataset; In the step S1, cloud images of a specific ocean area captured by a camera in a number of historical periods are collected, and the cloud type of each cloud image is annotated to obtain a cloud image dataset; The cloud types include: cirrus, stratocumulus and cumulonimbus; Collect wave data measured by wave meters in a specific ocean area over several historical periods, and use the wave data to calculate a wave time series data set; The wave data includes: wave height, wave period and wavelength data of the sea waves; The method of calculating the ocean wave time series data set using the wave data comprises the following steps: The intermediate effective wave height is calculated using the wave height, wave period and wavelength data of the ocean waves, specifically: Among them, Heff is the effective wave height, in meters; H is the wave height data, in meters; T is the wave period data, in seconds; L is the wavelength data, in meters; To find the square root function; The Douglas sea state grade formula is used to obtain the mapped sea state code C, which is: Wherein, C is the sea surface status code; Different sea surface state code C values ​​correspond to different sea surface state descriptions, specifically: C<1: The wave is level 0, indicating that the sea is calm; 1≤C<2: The wave is level 1, indicating that the sea surface is rippled; 2≤C<3: The wave is level 2, indicating that there are light waves on the sea surface; 3≤C<4: The wave is level 3, indicating that there are light to moderate waves on the sea surface; 4≤C<5: The wave is level 4, indicating that there are medium waves on the sea surface; 5≤C<6: The wave is level 5, indicating that there are heavy and medium waves on the sea surface; 6≤C<7: The wave is level 6, indicating heavy waves on the sea surface; 7≤C<8: The wave is level 7, indicating high waves on the sea surface; C≥8: The wave is level 8, indicating that there are strange waves on the sea surface; The sea surface state code C and the corresponding sea surface state description in all historical periods of a specific ocean area are saved together as the wave time series data set; S2: Build a marine weather forecast model; The marine weather prediction model comprises: an input layer, an image feature extraction module and a time series feature extraction module arranged in parallel, a feature fusion module and an output layer; The input layer is used to input cloud image data and ocean wave time series data; The image feature extraction module is used to extract features of cloud image data and obtain cloud image features; The time series feature extraction module is used to extract the features of the ocean wave time series data and obtain the ocean wave time series features; The feature fusion module is used to fuse cloud image features and wave time series features to obtain fusion features; The output layer is used to output weather forecast results according to the fusion features; The image feature extraction module is specifically a YOLOv8 neural network model; the time series feature extraction module is specifically a LSTM neural network model; The feature fusion module is specifically: The ocean wave temporal features output by the LSTM neural network model are spatially expanded to match the spatial dimensions of the cloud image features output by the YOLOv8 neural network model. The spatial dimension of the cloud image feature is , the spatial dimension of the wave time series characteristics is , where B is the batch size; C y is the number of channels of the YOLOv8 neural network model; C y ' is the number of channels of the LSTM neural network model; h and w are the height and width of the cloud image features respectively; The spatial expansion of the ocean wave time series characteristics is expressed as: Among them, Y3 is the spatial dimension of the temporal characteristics of the ocean waves after spatial expansion; represents the tensor product, is a matrix of all 1s with dimension h×w; The spatially expanded ocean wave temporal features and cloud image features are weighted summed in the channel dimension to obtain the fusion feature F, which is expressed as: in, and are the weight coefficients of cloud image features and wave time series features, respectively, satisfying ;[;] represents the concatenation operation in the channel dimension; The output layer includes a fully connected layer and a Sigmoid activation layer connected in sequence, and the weather forecast result is specifically a probability forecast value of the occurrence of different weather phenomena; The fused feature F is passed to the fully connected layer, and the output Z of the fully connected layer is expressed as: Among them, w3 and b are the weight matrix and bias vector of the fully connected layer respectively; The i-th output Z of the fully connected layer i After the Sigmoid activation layer, the output Z i Convert to probability values ​​to obtain the probability prediction values ​​of different weather phenomena, expressed as: P(yi)= 1 / (1+e -Zi ) Among them, y i represents the i-th weather phenomenon, P(y i ) is the probability of its occurrence; S3: Using the preprocessed historical data set to train the ocean weather prediction model to obtain a trained ocean weather prediction model; S4: Obtain real-time cloud image data and wave time series data of a specific ocean area and input them into a trained ocean weather prediction model for prediction to obtain real-time weather forecast results.

2. A method for predicting ocean weather based on a neural network according to claim 1, characterized in that: In step S1, preprocessing the cloud image dataset includes: S101: Data cleaning: Use the statistical method 3σ rule to eliminate abnormal data, where σ is the standard deviation of the cloud image dataset; use interpolation or smoothing to handle missing data; S102: Data standardization: linearly convert data of different dimensions to a unified numerical range of 0~1; S103: Data formatting: converting numerical data into tensor format and image data into matrix format to meet the input requirements of the neural network; The preprocessing of the wave time series dataset includes: S111: Data standardization: The wave time series data set is processed using the Z-score standardization method. The processed wave time series data set follows a standard normal distribution with a mean of 0 and a standard deviation of 1. S112: Detect and process outliers: The outliers are extreme values ​​that deviate from the normal distribution range of the data. For the wave time series data set, a quantile-based method is used to detect and process outliers, specifically: In the wave time series data set, the 25% quantile of all data is recorded as Q1, and the 75% quantile of all data is recorded as Q3, then the interquartile range IQR satisfies: IQR=Q3-Q1; If a wave time series data x satisfies: or , then the wave time series data x is regarded as an outlier; For detected outliers, directly remove them or use data interpolation methods to repair them; S113: Processing missing values: For missing values ​​in the wave time series data set, linear interpolation method is used to fill the missing values ​​within the missing interval; S114: Use One-Hot encoding to map the data of each time step into a high-dimensional sparse vector.

3. The method for predicting ocean weather based on a neural network according to claim 1, characterized in that: The step S3 comprises: Setting the total loss function for supervised ocean weather forecast model training , the total loss function Specifically: in, is the binary cross entropy loss function; is the target loss function of the YOLOv8 neural network model; is the loss function of the LSTM neural network model; and are the first and second balance coefficients, respectively; The loss function of the YOLOv8 neural network model Specifically: in, is the bounding box regression loss; Loss for the existence or non-existence of the target; is the classification loss; , and They are the third, fourth and fifth balance coefficients respectively; The loss function of the LSTM neural network model Specifically: in, is the mean square error loss function; is the regularization term; is the regularization coefficient; Using the total loss function Perform end-to-end joint training on the marine weather prediction model, and optimize the parameters of the YOLOv8 neural network model, LSTM neural network model, feature fusion module, and output layer; During the training process, stochastic gradient descent and back propagation are used to update parameters. The gradients of the feature fusion module flow to the YOLOv8 neural network model and the LSTM neural network model respectively. The YOLOv8 neural network model and the LSTM neural network model independently receive the gradients and update their parameters. The cosine annealing algorithm is used for learning rate scheduling to continuously optimize the training results until the total loss function When the minimum value is obtained, the trained ocean weather forecast model is obtained.

4. A method for predicting ocean weather based on a neural network according to any one of claims 1 to 3, characterized in that: The method further comprises: S5: Generate weather warning information for the current and future period based on real-time weather forecast results, and provide users with behavioral decision-making suggestions based on the weather warning information.

5. A marine weather forecasting system based on a neural network, using a marine weather forecasting method based on a neural network as claimed in any one of claims 1 to 4, characterized in that: include: Preprocessing unit: used to obtain cloud image datasets and wave time series datasets in several historical periods of a specific ocean area, save them together as historical datasets, and preprocess the historical datasets; Model building unit: used to build ocean weather prediction models; Model training unit: used to train the ocean weather prediction model using the preprocessed historical data set to obtain a trained ocean weather prediction model; Weather forecast unit: used to obtain real-time cloud image data and wave time series data of a specific ocean area and input them into the trained ocean weather forecast model for prediction to obtain real-time weather forecast results.

Citation Information

Patent Citations

  • Offshore wind field inversion method based on improved CNN-LSTM network

    CN118690669A