Sea fog quantitative forecasting method and device based on period enhanced Transform
By adopting a quantitative sea fog forecasting method based on periodic enhanced Transformer, the problems of low resolution, short timeliness and scarce samples in existing sea fog forecasting technologies are solved. This method achieves high-precision and automated sea fog forecasting, which can accurately capture the seasonal and diurnal variation patterns of sea fog and provide hourly quantitative visibility grid forecasts.
Patent Information
- Application Number
- CN202510746311.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-10-31
Smart Images

Figure CN120871298A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of weather forecasting technology, and in particular to a quantitative forecasting method and apparatus for sea fog based on periodic enhanced Transformer. Background Technology
[0002] Sea fog is a significant meteorological disaster affecting maritime traffic, operations, and life in coastal areas.
[0003] Current methods for sea fog forecasting mainly include:
[0004] 1. Numerical Weather Prediction (NWP) Models: Global and regional scale models. These models predict weather by simulating atmospheric physical processes. However, existing numerical models generally have insufficient ability to predict sea fog: (1) the simulation of sea fog, a local and complex phenomenon within the boundary layer, is not refined enough, and the resolution is often low; (2) the physical process parameterization schemes in the models (especially cloud microphysics and boundary layer schemes) do not accurately characterize the formation, maintenance, and dissipation mechanisms of sea fog; (3) some regional models have limitations such as short operational forecast lead time and inability to predict visibility in areas without water vapor condensation. Therefore, the accuracy and reliability of directly using NWP models for sea fog forecasting need to be improved.
[0005] 2. Statistical Forecasting Methods: Statistical forecasting methods related to sea fog mainly establish forecasting models based on historical data and statistical regularities. Examples include multiple regression, decision trees (e.g., Huang et al., 2011; Cao et al., 2020), and model output statistics (MOS, e.g., Huang Huijun, 2010). These methods rely on assumptions of linear or specific nonlinear relationships between forecasting factors and forecasting targets. For sea fog, a phenomenon influenced by the complex interactions of multiple factors, their ability to capture its complete dynamic characteristics is limited.
[0006] 3. Early Machine Learning Methods: In recent years, some machine learning methods, such as Artificial Neural Networks (ANNs), Recurrent Neural Networks (RNNs), and Long Short-Term Memory Networks (LSTMs), have been attempted to be applied to visibility or fog forecasting (e.g., Li et al., 2019, used RNNs to forecast single-station visibility). These methods have advantages over traditional statistical methods in processing time series data, but RNNs / LSTMs may face gradient vanishing or gradient exploding problems when processing very long time series, and may struggle to fully capture the complex long-distance temporal dependence and periodicity characteristics of sea fog.
[0007] The patent "A Smart Method and System for Sea Fog Level Forecasting" (CN202111590828.3) discloses a fog occurrence forecasting method that uses machine learning to process meteorological data, but it lacks the acquisition of long-range periodic characteristics. The patent "A Sea Fog Forecasting Method Based on Machine Learning" (CN202310768441.5) proposes a marine visibility forecasting method based on decision trees, but it fails to effectively handle the periodic variation characteristics of sea fog.
[0008] As artificial intelligence technology is increasingly applied in the field of weather forecasting, existing technologies still have the following shortcomings:
[0009] 1. Traditional numerical models have limited ability to predict sea fog, especially when dealing with complex nonlinear relationships;
[0010] 2. Existing machine learning models often fail to effectively capture the periodic variations in sea fog;
[0011] 3. The relatively small number of sea fog samples resulted in poor model training performance;
[0012] 4. The nonlinear distribution of visibility data makes it difficult for models to accurately predict extreme values;
[0013] 5. There is a lack of forecasting models for certain complex geographical environments and meteorological conditions. Summary of the Invention
[0014] The purpose of this invention is to at least address one of the shortcomings of the prior art and provide a quantitative forecasting method for sea fog based on periodic enhanced Transformer.
[0015] To achieve the above objectives, the present invention adopts the following technical solution:
[0016] Specifically, a quantitative sea fog forecasting method based on periodically enhanced Transformer is proposed, including the following:
[0017] Acquire multi-source data related to sea fog in the target area, and preprocess the multi-source data to obtain processed data;
[0018] The processed data is used to construct a dataset by selecting forecast factors, enhancing time periods, standardizing visibility mapping, and expanding samples. The dataset is then divided and balanced to obtain a training set, a validation set, and a test set.
[0019] The pre-built periodic augmented Transformer model is trained using the training set, validation set, and test set to obtain the periodic augmented Transformer model;
[0020] The input data is acquired, preprocessed and time-period enhancement is performed on the input data to obtain processed input data, and the processed input data is input into the trained period-enhanced Transformer model to obtain the standardized visibility forecast value for each hour in the future.
[0021] The standardized visibility forecast values for each hour in the future are converted back to actual physical visibility values through the inverse operation of the visibility standardization mapping.
[0022] Quantitative sea fog forecasting is performed on the target area based on actual physical visibility values.
[0023] Furthermore, specifically, the acquired multi-source data includes data from ground meteorological observation stations, ocean buoy observation data, satellite remote sensing data, lidar detection data, radiosonde data, numerical weather prediction (NWP) model data, pseudo-equivalent potential temperature, and potential temperature difference between 1000 hPa and 925 hPa.
[0024] Furthermore, specifically, the preprocessing operation includes,
[0025] The multi-source data is cleaned to remove outliers and fill in missing values, and then subjected to spatiotemporal matching and format unification.
[0026] Furthermore, specifically, the selection of forecasting factors includes,
[0027] Based on meteorological mechanism analysis and automated tools, the importance of features under various models is evaluated, and parameters that contribute significantly to sea fog visibility forecasting are selected from the processed data as forecasting factors.
[0028] Furthermore, specifically, the enhanced time period includes,
[0029] Using sine and cosine decomposition methods, the annual and daily cycles are mapped to two-dimensional space respectively, constructing a four-dimensional time vector as an additional forecasting factor:
[0030] The sinusoidal component of the annual cycle is: sin_year = sin(day_of_year / (365.25×2π));
[0031] The cosine component of the annual cycle is: cos_year = cos(day_of_year / (365.25×2π));
[0032] The sinusoidal component of the daily cycle is: sin_day = sin(hour_of_day / (24×2π));
[0033] The cosine component of the daily cycle: cos_day=cos(hour_of_day / (24×2π));
[0034] Where day_of_year is the day of the year, hour_of_day is the hour of the day, and pi refers to the mathematical constant π.
[0035] Furthermore, specifically, visibility normalization mapping includes,
[0036] A piecewise function is used to standardize the visibility (vis) mapping, defining the fog range as vis < 1000m and the light fog range as 1000m <= vis. <10000m and fog-free zones are vis> =10000m. The three intervals are mapped to the ranges [0,1), [1,2), and [2,3] respectively, increasing the relative numerical range of the low visibility interval:
[0037] y = vis / 1000, when vis < 1000;
[0038] y=(vis-1000) / 9000+1, when 1000<=vis<10000;
[0039] y=(vis-10000) / 20000+2, when vis>=10000;
[0040] The standardized visibility value y is used as the forecast target of the periodically enhanced Transformer model. This standardized mapping is invertible.
[0041] Furthermore, specifically, the sample amplification includes temporal resampling and spatial combination sampling.
[0042] The time resampling method involves using an interpolation method to upsample forecast factors with frequencies lower than a preset level to match the target forecast frequency.
[0043] The spatial combination sampling method involves combining and pairing neighboring NWP grid data. It is assumed that the meteorological element fields within a small area around the target station or grid have spatial consistency. The observed visibility of the target station or grid is combined with the forecast factors of multiple neighboring NWP grids to form multiple samples.
[0044] Furthermore, specifically, the model architecture of the pre-built cyclically enhanced Transformer model includes,
[0045] Input Embedding: Maps the input feature sequence containing meteorological factors and a four-dimensional time vector into a high-dimensional vector;
[0046] Positional Encoding: Adds positional information to the embedding vector, enabling the model to understand the temporal order of the input sequence;
[0047] Multi-Head Self-Attention: This mechanism allows the model to simultaneously attend to all other time steps in the input sequence while processing each time step in the sequence, and dynamically calculates weights based on relevance, effectively capturing long-distance temporal dependencies and complex feature interactions.
[0048] Feed-Forward Network: After a multi-head self-attention layer, an independent nonlinear transformation is performed on the representation at each location;
[0049] Residual Connection and Layer Normalization: used to stabilize the training process, accelerate convergence, and alleviate the gradient vanishing problem;
[0050] Output Layer: Maps the output of the Transformer encoder to the final normalized visibility value y of the forecast target.
[0051] Furthermore, the method also includes,
[0052] The constructed dataset is divided into training, validation and test sets in chronological order to ensure that there is no time overlap between the sets, so as to simulate real forecasting scenarios;
[0053] In the training set, the proportions of samples for fog, light fog, and no fog events are adjusted to make the ratio of the three types of samples close to 1:1:1, in order to avoid the model being biased towards the majority class during training and to improve its ability to fit low-probability fog events.
[0054] This invention also proposes a quantitative sea fog forecasting device based on a periodically enhanced Transformer, comprising the following:
[0055] The training data acquisition module is used to acquire multi-source data related to sea fog in the target area, and to preprocess the multi-source data to obtain processed data;
[0056] The dataset partitioning module is used to construct a dataset from the processed data by selecting forecast factors, enhancing time periods, standardizing visibility mapping, and expanding samples, and to partition and balance the dataset to obtain a training set, a validation set, and a test set.
[0057] The model training module is used to train a pre-built periodic augmentation Transformer model using a training set, a validation set, and a test set to obtain a trained periodic augmentation Transformer model.
[0058] The input data acquisition module is used to acquire input data, perform preprocessing and time period enhancement processing on the input data to obtain processed input data, and input the processed input data into the trained period enhancement Transformer model to obtain the standardized visibility forecast value for each hour in the future.
[0059] The numerical conversion module is used to convert the standardized visibility forecast values for each hour in the future back to the actual physical visibility values through the inverse operation of the visibility standardization mapping.
[0060] The quantitative sea fog forecasting module is used to make quantitative sea fog forecasts for target areas based on actual physical visibility values.
[0061] The beneficial effects of this invention are as follows:
[0062] This invention proposes a quantitative sea fog forecasting method based on periodic enhancement Transformer. First, a Transformer model is constructed as the forecasting model. The Transformer model and its self-attention mechanism can better capture the complex nonlinear relationships and long-distance temporal dependencies involved in sea fog formation, outperforming traditional statistical methods and early RNN / LSTM models. Then, a training dataset for the model is constructed based on time period enhancement techniques and visibility normalization mapping. Explicit time period enhancement techniques (sine / cosine decomposition) enable the model to more accurately learn and forecast the seasonal and diurnal variation patterns of sea fog. Furthermore, a sample amplification and training set balancing strategy is implemented on this dataset to effectively address the problem of sparse fog samples, improving the model's forecasting ability for key low-visibility events. The proposed quantitative sea fog forecasting method based on periodic enhancement Transformer can improve the accuracy, timeliness (achieving hourly forecasts), and spatial resolution (gridized forecasts) of sea fog forecasts in target areas, and can effectively handle the characteristics of sea fog data (periodicity, sample sparsity, and numerical non-normality). Attached Figure Description
[0063] The above and other features of this disclosure will become more apparent from the detailed description of the embodiments illustrated in conjunction with the accompanying drawings. In the accompanying drawings, the same reference numerals denote the same or similar elements. Obviously, the drawings described below are merely some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort. In the drawings:
[0064] Figure 1 The diagram shows a flowchart of training data acquisition and data preprocessing in this invention.
[0065] Figure 2 The diagram shown is a flowchart of the dataset construction process in this invention;
[0066] Figure 3 The diagram shows the architecture of the periodic enhancement Transformer model proposed in this invention.
[0067] Figure 4 The diagram shows the forecast generation and evaluation process for quantitative sea fog forecasting according to the present invention. Detailed Implementation
[0068] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The same reference numerals used throughout the accompanying drawings indicate the same or similar parts.
[0069] Example 1, referring to Figure 1 ( Figure 1 The flowchart illustrates the main steps of data acquisition and preprocessing. Data acquisition includes multi-source data such as ground meteorological observation stations, ocean buoys, and satellite remote sensing; preprocessing steps include data cleaning, spatiotemporal matching, and format standardization (providing a high-quality data foundation for subsequent modeling). Figure 2 ( Figure 2 The flowchart describes the key steps in feature engineering and dataset construction. Through steps such as forecast factor selection, time period enhancement, visibility normalization mapping, and sample augmentation, training, validation, and test sets are constructed to prepare data for model training. Figure 4 ( Figure 4 The flowchart illustrates the process of generating and evaluating model forecast results. Starting with generating a standardized visibility forecast, obtaining physical visibility through inverse standardization, generating gridded forecast products, and finally evaluating model performance to form a complete forecast evaluation system, this invention proposes a quantitative sea fog forecasting method based on periodically enhanced Transformers, comprising the following:
[0070] Acquire multi-source data related to sea fog in the target area, and preprocess the multi-source data to obtain processed data;
[0071] The processed data is used to construct a dataset by selecting forecast factors, enhancing time periods, standardizing visibility mapping, and expanding samples. The dataset is then divided and balanced to obtain a training set, a validation set, and a test set.
[0072] The pre-built periodic augmented Transformer model is trained using the training set, validation set, and test set to obtain the periodic augmented Transformer model;
[0073] The input data is acquired, preprocessed and time-period enhancement is performed on the input data to obtain processed input data, and the processed input data is input into the trained period-enhanced Transformer model to obtain the standardized visibility forecast value for each hour in the future.
[0074] The standardized visibility forecast values for each hour in the future are converted back to actual physical visibility values through the inverse operation of the visibility standardization mapping.
[0075] Quantitative sea fog forecasting is performed on the target area based on actual physical visibility values.
[0076] In this embodiment 1, a Transformer model is first constructed as the forecasting model. The Transformer model and its self-attention mechanism can better capture the complex nonlinear relationships and long-distance temporal dependencies involved in sea fog formation, outperforming traditional statistical methods and early RNN / LSTM models. Then, a training dataset for the model is constructed based on time period enhancement techniques and visibility normalization mapping. Explicit time period enhancement techniques (sine / cosine decomposition) enable the model to more accurately learn and forecast the seasonal and diurnal variation patterns of sea fog. Furthermore, a sample amplification and training set balancing strategy is implemented on this dataset to effectively address the problem of sparse fog samples, improving the model's forecasting ability for key low-visibility events. The quantitative sea fog forecasting method based on periodic enhancement Transformer proposed in this invention can improve the accuracy, timeliness (achieving hourly forecasts), and spatial resolution (gridized forecasts) of sea fog forecasts in target areas, and can effectively handle the characteristics of sea fog data (periodicity, sample sparsity, and numerical non-normality).
[0077] As a preferred embodiment of the present invention, the acquired multi-source data specifically includes ground meteorological observation station data, ocean buoy observation data, satellite remote sensing data, lidar detection data, radiosonde data, numerical weather prediction (NWP) model data, pseudo-equivalent potential temperature, and potential temperature difference between 1000 hPa and 925 hPa.
[0078] In this preferred embodiment, multi-source data related to sea fog in the target area are collected, including but not limited to:
[0079] Ground meteorological observation station data (historical and real-time, such as Xuwen station): visibility, air temperature, dew point temperature, wind speed and direction, air pressure, etc., hourly or at higher frequencies.
[0080] Ocean buoy observation data (such as Zhanjiang Buoy Station): Sea surface temperature (SST), air temperature, humidity, etc., every 10 minutes or more.
[0081] Satellite remote sensing data: provides information on cloud tops, sea surface temperature, etc.
[0082] LiDAR detection data: provides information on boundary layer structure, aerosols, etc.
[0083] Radiosonde data (such as Haikou station): provides information on atmospheric stratification.
[0084] Numerical weather prediction (NWP) model data: For example, the forecast field of the ECMWF global model or regional model (such as GRAPES), selecting forecast factors such as 2-meter surface air temperature, surface dew point temperature, sea surface temperature, 10-meter wind, 100-meter wind, 925-hPa wind, and 925-hPa.
[0085] Pseudo-equivalent potential temperature, potential temperature difference between 1000hPa and 925hPa, etc., covering different forecast lead times (such as 0-120 hours).
[0086] In a preferred embodiment of the present invention, the preprocessing operation specifically includes:
[0087] The multi-source data is cleaned to remove outliers and fill in missing values, and then subjected to spatiotemporal matching and format unification.
[0088] In this preferred embodiment, the collected data is cleaned (outliers removed, missing data filled), spatiotemporally matched, and formatted to ensure data quality and consistency.
[0089] In a preferred embodiment of the present invention, specifically, the selection of forecast factors includes,
[0090] Based on meteorological mechanism analysis and automated tools, the importance of features under various models is evaluated, and parameters that contribute significantly to sea fog visibility forecasting are selected from the processed data as forecasting factors.
[0091] In this preferred embodiment, based on meteorological mechanism analysis and automated tools, the importance of features under various models (GLM, GBM, XGBoost, RF, ET, DL) is evaluated, and key forecasting factors with high contributions to sea fog (visibility) forecasting are screened from the preprocessed data. Examples include: surface air temperature, dew point temperature, sea surface temperature, air-sea temperature difference (Tair-SST), and dew point-sea temperature difference (T). dew -SST), wind speed and direction (at different levels), atmospheric stability parameters (such as potential temperature difference), etc.
[0092] Specifically, ① Initial screening of meteorological mechanisms: Based on the meteorological formation principles of fog and the meteorological and geographical characteristics during fog occurrence, meteorological parameters related to sea fog formation are initially selected, such as air temperature, dew point temperature, wind speed and direction, sea surface temperature, potential temperature difference, pseudo-equivalent potential temperature, air-sea temperature difference, and dew point-sea temperature difference. These factors are closely related to the formation mechanisms of various types of sea fog, including radiation fog, advection fog, and evaporation fog.
[0093] ② Feature Importance Assessment: Multiple general regression models (GBM, XGBoost, Random Forest (RF), Deep Learning (DL), etc.) are used to calculate the feature importance value for each factor on the training dataset. Each model ranks the features, and the average ranking is used as the final evaluation criterion. If a factor consistently ranks in the top 10% across multiple models and its feature contribution is significantly higher than other factors, it is considered a strongly correlated predictive factor.
[0094] In a preferred embodiment of the present invention, specifically considering the significant seasonal and diurnal variation cycles of sea fog, the time variable is periodically encoded to enhance the model's ability to capture this periodicity. This time period enhancement includes:
[0095] Using sine and cosine decomposition methods, the annual and daily cycles are mapped to two-dimensional space respectively, constructing a four-dimensional time vector as an additional forecasting factor:
[0096] The sinusoidal component of the annual cycle is: sin_year = sin(day_of_year / (365.25×2π));
[0097] The cosine component of the annual cycle is: cos_year = cos(day_of_year / (365.25×2π));
[0098] The sinusoidal component of the daily cycle is: sin_day = sin(hour_of_day / (24×2π));
[0099] The cosine component of the daily cycle: cos_day=cos(hour_of_day / (24×2π));
[0100] Where day_of_year is the day of the year, and hour_of_day is the hour of the day.
[0101] As a preferred embodiment of the present invention, specifically, the visibility normalization mapping includes...
[0102] Because visibility values (especially in the fog range of 0-1km) constitute a small proportion of the total measurement range (up to 30km or more) and their distribution is non-normal, the model is prone to underfitting low visibility events. A piecewise function is used to standardize the visibility (vis) mapping, defining the fog range as vis < 1000m and the light fog range as 1000m <= vis. <10000m and fog-free zones are vis> =10000m. The three intervals are mapped to the ranges [0,1), [1,2), and [2,3] respectively, increasing the relative numerical range of the low visibility interval:
[0103] y = vis / 1000, when vis < 1000;
[0104] y=(vis-1000) / 9000+1, when 1000<=vis<10000;
[0105] y=(vis-10000) / 20000+2, when vis>=10000;
[0106] The standardized visibility value y is used as the forecast target of the periodically enhanced Transformer model. This standardized mapping is invertible.
[0107] As a preferred embodiment of the present invention, specifically addressing the problem of relatively sparse sea fog (low visibility) event samples, the following method is used to amplify fog samples or balanced datasets. This sample amplification includes temporal resampling and spatial combination sampling.
[0108] The time resampling method involves using an interpolation method to upsample forecast factors with frequencies lower than a preset level to match the target forecast frequency.
[0109] The spatial combination sampling method involves combining and pairing neighboring NWP grid data. It is assumed that the meteorological element fields within a small area around the target station or grid have spatial consistency. The observed visibility of the target station or grid is combined with the forecast factors of multiple neighboring NWP grids to form multiple samples.
[0110] Reference Figure 3 ( Figure 3 The flowchart illustrates the core architecture of the periodic augmentation Transformer model. Starting from the input embedding layer, it passes through key components such as position encoding, multi-head self-attention mechanism, feedforward network, and residual connection, finally outputting the forecast result. The model structure design fully considers the characteristics of the sea fog forecasting task. As a preferred embodiment of the present invention, specifically, the pre-built periodic augmentation Transformer model architecture includes...
[0111] Input Embedding: Maps the input feature sequence containing meteorological factors and a four-dimensional time vector into a high-dimensional vector;
[0112] Positional Encoding: Adds positional information to the embedding vector, enabling the model to understand the temporal order of the input sequence;
[0113] Multi-Head Self-Attention: This mechanism allows the model to simultaneously attend to all other time steps in the input sequence while processing each time step in the sequence, and dynamically calculates weights based on relevance, effectively capturing long-distance temporal dependencies and complex feature interactions.
[0114] Feed-Forward Network: After a multi-head self-attention layer, an independent nonlinear transformation is performed on the representation at each location;
[0115] Residual Connection and Layer Normalization: used to stabilize the training process, accelerate convergence, and alleviate the gradient vanishing problem;
[0116] Output Layer: Maps the output of the Transformer encoder to the final normalized visibility value y of the forecast target.
[0117] In a preferred embodiment of the present invention, the method further includes,
[0118] The constructed dataset is divided into training set, validation set and test set in chronological order (e.g., ratio 7:1:2) to ensure that there is no time overlap between the sets, so as to simulate real forecast scenarios;
[0119] In the training set, the proportions of samples for the three types of events—fog, light fog, and no fog—are adjusted (e.g., by undersampling the majority class samples or oversampling the minority class samples, or by a combination thereof) so that the proportions of the three classes are close to 1:1:1. This is to prevent the model from being biased towards the majority class (no fog) during training and to improve its ability to fit low-probability fog events.
[0120] In addition, when training the Transformer model, the balanced training set prepared above is used to train the Transformer model.
[0121] The training process is monitored using a validation set, and model selection and hyperparameter tuning are performed (using Bayesian optimization methods to adjust model depth, number of attention heads, hidden layer dimension, learning rate, etc.).
[0122] The optimization objective is to minimize the loss function (mean squared error, MSE) between the forecast value and the actual standardized visibility value.
[0123] In addition, sea fog forecasting, generation, and assessment specifically include the following:
[0124] 1. Forecast generation: Input the latest input data (such as the NWP forecast field) that has undergone the same preprocessing and feature engineering (including time period enhancement) into the trained Transformer model to obtain the standardized visibility forecast value y_pred for each hour in the future.
[0125] 2. Inverse standardization: Apply the inverse function of the standardization mapping function to the model output y_pred to convert it back to the actual physical visibility value vis_pred (unit: meters).
[0126] The inverse mapping function corresponding to the standardized mapping function mentioned above is:
[0127] vis_pred=y_pred*1000 (when 0<=y_pred<1)
[0128] vis_pred=(y_pred-1)*9000+1000(when 1<=y_pred<2)
[0129] vis_pred=(y_pred-2)*20000+10000 (when 2<=y_pred<=3)
[0130] 3. Product generation: The calculated vis_pred is organized into hourly visibility grid forecast products for the target area.
[0131] 4. Model Evaluation: The model's forecast performance is comprehensively evaluated using an independent test set. Evaluation metrics may include: root mean square error (RMSE), mean absolute error (MAE), correlation coefficient, and classification forecast scores for fog events (hit rate, false alarm rate, critical success index CSI / TS score, etc.). The forecast results are then compared with traditional numerical model forecasts and other baseline models.
[0132] Example 2: This invention also proposes a quantitative sea fog forecasting device based on a periodically enhanced Transformer, comprising the following:
[0133] The training data acquisition module is used to acquire multi-source data related to sea fog in the target area, and to preprocess the multi-source data to obtain processed data;
[0134] The dataset partitioning module is used to construct a dataset from the processed data by selecting forecast factors, enhancing time periods, standardizing visibility mapping, and expanding samples, and to partition and balance the dataset to obtain a training set, a validation set, and a test set.
[0135] The model training module is used to train a pre-built periodic augmentation Transformer model using a training set, a validation set, and a test set to obtain a trained periodic augmentation Transformer model.
[0136] The input data acquisition module is used to acquire input data, perform preprocessing and time period enhancement processing on the input data to obtain processed input data, and input the processed input data into the trained period enhancement Transformer model to obtain the standardized visibility forecast value for each hour in the future.
[0137] The numerical conversion module is used to convert the standardized visibility forecast values for each hour in the future back to the actual physical visibility values through the inverse operation of the visibility standardization mapping.
[0138] The quantitative sea fog forecasting module is used to make quantitative sea fog forecasts for target areas based on actual physical visibility values.
[0139] In this second embodiment, consistent with the proposed quantitative sea fog forecasting method based on periodic enhancement Transformer, a Transformer model is first constructed as the forecasting model. The Transformer model and its self-attention mechanism can better capture the complex nonlinear relationships and long-distance temporal dependencies involved in sea fog formation, outperforming traditional statistical methods and early RNN / LSTM models. Then, a training dataset for the model is constructed based on periodic enhancement techniques and visibility normalization mapping. Explicit periodic enhancement techniques (sine / cosine decomposition) enable the model to more accurately learn and forecast the seasonal and diurnal variation patterns of sea fog. Furthermore, a sample amplification and training set balancing strategy is implemented on this dataset to effectively address the problem of sparse fog samples, improving the model's forecasting ability for key low-visibility events. The proposed quantitative sea fog forecasting method based on periodic enhancement Transformer can improve the accuracy, timeliness (achieving hourly forecasts), and spatial resolution (gridized forecasts) of sea fog forecasts in target areas, and can effectively handle the characteristics of sea fog data (periodicity, sample sparsity, and numerical non-normality).
[0140] When implementing the quantitative sea fog forecasting method and device based on periodic enhanced Transformer proposed in this invention,
[0141] Data preparation (Step A): Collect hourly surface observation data (visibility, air temperature, dew point, etc.) from 2013 to 2022, 10-minute sea surface temperature data from buoy stations for the past three years, radiosonde data from Haikou station, and 3-hour interval forecast field data of the ECMWF model with a lead time of 0-120 hours during the same period. Perform quality control and spatiotemporal matching on these data.
[0142] Feature and Dataset Construction (Step B):
[0143] Factor selection (B1): The surface 2m air temperature, 2m dew point, sea surface temperature, 10m / 100m / 925hPa wind speed and direction, 925hPa pseudo equivalent potential temperature, and 1000-925hPa potential temperature difference, etc., predicted by ECMWF, and the air-sea temperature difference and dew point-sea temperature difference calculated by combining the observation data are selected as the basic forecast factors.
[0144] Time Augmentation (B2): Calculate four time features sin_year, cos_year, sin_day, and cos_day based on the date and hour of the sample.
[0145] Visibility standardization (B3): The hourly visibility vis (meters) observed is mapped to a standardized target value y using the aforementioned piecewise function.
[0146] Sample augmentation (B4): The 3-hour interval factor of ECMWF-IFS is linearly interpolated to the 1-hour interval. Visibility observations are used at the target station (e.g., Xuwen station), and the IFS forecast factors of its own location and the eight neighboring grid points are matched to form a sample pair with a number nine times greater than the original.
[0147] Dataset Construction and Balancing (B5): All processed (feature + target y) samples were divided into a training set (70%), a validation set (10%), and a test set (20%) in chronological order. In the training set, no-fog and light-fog samples were randomly undersampled to ensure that the ratio of fog (yin[0,1)), light-fog (yin[1,2)), and no-fog (yin[2,3]) samples was 1:1:1.
[0148] Model training (step C):
[0149] Model Construction (C1): Construct a Transformer model that includes an input embedding layer, a positional encoding layer, multiple (e.g., 6) Transformer encoder layers (each containing a multi-head self-attention sublayer and a feedforward network sublayer, with residual connections and layer normalization applied) and a linear output layer.
[0150] Training (C2): The Adam optimizer is used, with mean squared error as the loss function, to train the model on a balanced training set. The loss is monitored using the validation set, an early stopping strategy is implemented, and the optimal combination of hyperparameters (such as the number of attention heads, hidden layer dimension, dropout rate, etc.) is determined through random search.
[0151] Forecasting and Assessment (Step D):
[0152] Forecasts (D1, D2, D3): The ECMWF-IFS forecast factors for future time periods undergo the same preprocessing and feature engineering, and are input into the trained model to obtain the standardized visibility y_pred. The inverse standardization function is then applied to obtain the physical visibility vis_pred. Hourly visibility grid forecast maps for the next 0-120 hours are generated.
[0153] Evaluation (D4): RMSE, MAE, correlation coefficient, and TS score for fog events with visibility <1000m are calculated on the test set. These metrics are compared with those obtained by directly using the ECMWF model output or other benchmark models to verify the superiority of the proposed method. For example, it is expected that this method will significantly improve the TS score for fog events compared to the baseline model.
[0154] Through specific implementation, it has been determined that the quantitative sea fog forecasting method and device based on periodic enhanced Transformer proposed in this invention has the following advantages:
[0155] 1. Improve forecast accuracy: The Transformer model and its self-attention mechanism can better capture the complex nonlinear relationships and long-distance time dependencies involved in sea fog formation, outperforming traditional statistical methods and early RNN / LSTM models.
[0156] 2. Enhanced periodicity capture: Explicit time-period enhancement techniques (sine / cosine decomposition) enable the model to learn and forecast the seasonal and diurnal variations of sea fog more accurately.
[0157] 3. Effectively handle data characteristics:
[0158] Visibility standardization mapping solves the problem of underfitting the model due to uneven distribution of visibility values and the small proportion of extreme values (fog).
[0159] The sample amplification and training set balancing strategies effectively address the problem of sparse fog samples and improve the model's ability to predict key low-visibility events.
[0160] 4. Achieve quantitative and refined forecasts: It can provide hourly, quantitative visibility grid forecast products, meeting the needs of shipping, fisheries, traffic management and other industries for high-precision and high-timeliness sea fog forecasts.
[0161] 5. Automation and Intelligence: Machine learning-based methods are easy to automate, reducing reliance on forecasters' subjective experience and improving forecast efficiency and stability.
[0162] 6. Highly targeted: The method is designed and optimized for the characteristics of specific sea fog-prone areas, making the forecast more targeted.
[0163] Although the description of the invention has been quite detailed and particularly of several described embodiments, it is not intended to limit it to any of these details or embodiments or any particular embodiment, but should be considered as providing a broad possible interpretation of the claims by referring to the appended claims and taking into account the prior art, thereby effectively covering the intended scope of the invention. Furthermore, the invention has been described above with respect to embodiments foreseeable by the inventors in order to provide a useful description, and non-substantial modifications to the invention that have not yet been foreseen may still represent equivalent modifications.
[0164] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any embodiment that achieves the technical effects of the present invention using the same means should fall within the protection scope of the present invention. Within the protection scope of the present invention, various modifications and variations can be made to the technical solutions and / or implementation methods.
Claims
1. A quantitative forecasting method for sea fog based on periodically enhanced Transformer, characterized in that, Including the following: Acquire multi-source data related to sea fog in the target area, and preprocess the multi-source data to obtain processed data; The processed data is used to construct a dataset by selecting forecast factors, enhancing time periods, standardizing visibility mapping, and expanding samples. The dataset is then divided and balanced to obtain a training set, a validation set, and a test set. The pre-built periodic augmented Transformer model is trained using the training set, validation set, and test set to obtain the periodic augmented Transformer model; The input data is acquired, preprocessed and time-period enhancement is performed on the input data to obtain processed input data, and the processed input data is input into the trained period-enhanced Transformer model to obtain the standardized visibility forecast value for each hour in the future. The standardized visibility forecast values for each hour in the future are converted back to actual physical visibility values through the inverse operation of the visibility standardization mapping. Quantitative sea fog forecasting is performed on the target area based on actual physical visibility values.
2. The quantitative sea fog forecasting method based on periodic enhanced Transformer according to claim 1, characterized in that, Specifically, the acquired multi-source data includes data from ground meteorological observation stations, ocean buoy observation data, satellite remote sensing data, lidar detection data, radiosonde data, numerical weather prediction (NWP) model data, pseudo-equivalent potential temperature, and potential temperature difference between 1000 hPa and 925 hPa.
3. The quantitative sea fog forecasting method based on periodic enhanced Transformer according to claim 1, characterized in that, Specifically, the preprocessing operations include, The multi-source data is cleaned to remove outliers and fill in missing values, and then subjected to spatiotemporal matching and format unification.
4. The quantitative sea fog forecasting method based on periodic enhanced Transformer according to claim 1, characterized in that, Specifically, the selection of forecast factors includes, based on meteorological mechanism analysis and automated tools, evaluating the importance of features under multiple models, and selecting parameters that contribute highly to sea fog visibility forecasting from the processed data as forecast factors.
5. The quantitative sea fog forecasting method based on periodic enhanced Transformer according to claim 4, characterized in that, Specifically, the time period enhancement includes, Using sine and cosine decomposition methods, the annual and daily cycles are mapped to two-dimensional space respectively, constructing a four-dimensional time vector as an additional forecasting factor: The sinusoidal component of the annual cycle is: sin_year = sin(day_of_year / (365.25×2π)); The cosine component of the annual cycle is: cos_year = cos(day_of_year / (365.25×2π)); The sinusoidal component of the daily cycle is: sin_day = sin(hour_of_day / (24×2π)); The cosine component of the daily cycle: cos_day=cos(hour_of_day / (24×2π)); Where day_of_year is the day of the year, and hour_of_day is the hour of the day.
6. The quantitative sea fog forecasting method based on periodic enhanced Transformer according to claim 5, characterized in that, Specifically, visibility normalization mapping includes, A piecewise function is used to standardize the visibility (vis) mapping, defining the fog range as vis < 1000m and the light fog range as 1000m <= vis. <10000m and fog-free zones are vis> =10000m. The three intervals are mapped to the ranges [0,1), [1,2), and [2,3] respectively, increasing the relative numerical range of the low visibility interval: y = vis / 1000, when vis < 1000; y=(vis-1000) / 9000+1,when 1000<=vis <10000; y=(vis-10000) / 20000+2, when vis>=10000; The standardized visibility value y is used as the forecast target of the periodically enhanced Transformer model. This standardized mapping is invertible.
7. The quantitative sea fog forecasting method based on periodic enhanced Transformer according to claim 6, characterized in that, Specifically, the sample amplification includes temporal resampling and spatial combination sampling. The time resampling method involves using an interpolation method to upsample forecast factors with frequencies lower than a preset level to match the target forecast frequency. The spatial combination sampling method involves combining and pairing neighboring NWP grid data. It is assumed that the meteorological element fields within a small area around the target station or grid have spatial consistency. The observed visibility of the target station or grid is combined with the forecast factors of multiple neighboring NWP grids to form multiple samples.
8. The quantitative sea fog forecasting method based on periodic enhanced Transformer according to claim 6, characterized in that, Specifically, the model architecture of the pre-built cyclic augmentation Transformer model includes, Input Embedding: Maps the input feature sequence containing meteorological factors and a four-dimensional time vector into a high-dimensional vector; Positional Encoding: Adds positional information to the embedding vector, enabling the model to understand the temporal order of the input sequence; Multi-Head Self-Attention: This mechanism allows the model to simultaneously attend to all other time steps in the input sequence while processing each time step in the sequence, and dynamically calculates weights based on relevance, effectively capturing long-distance temporal dependencies and complex feature interactions. Feed-Forward Network: After a multi-head self-attention layer, an independent nonlinear transformation is performed on the representation at each location; Residual Connection and Layer Normalization: used to stabilize the training process, accelerate convergence, and alleviate the gradient vanishing problem; Output Layer: Maps the output of the Transformer encoder to the final normalized visibility value y of the forecast target.
9. The quantitative sea fog forecasting method based on periodic enhanced Transformer according to claim 1, characterized in that, The method also includes, The constructed dataset is divided into training, validation and test sets in chronological order to ensure that there is no time overlap between the sets, so as to simulate real forecasting scenarios; In the training set, the proportions of samples for fog, light fog, and no fog events are adjusted to make the ratio of the three types of samples close to 1:1:1, in order to avoid the model being biased towards the majority class during training and to improve its ability to fit low-probability fog events.
10. A quantitative sea fog forecasting device based on periodic enhanced Transformer, characterized in that, Including the following: The training data acquisition module is used to acquire multi-source data related to sea fog in the target area, and to preprocess the multi-source data to obtain processed data; The dataset partitioning module is used to construct a dataset from the processed data by selecting forecast factors, enhancing time periods, standardizing visibility mapping, and expanding samples, and to partition and balance the dataset to obtain a training set, a validation set, and a test set. The model training module is used to train a pre-built periodic augmentation Transformer model using a training set, a validation set, and a test set to obtain a trained periodic augmentation Transformer model. The input data acquisition module is used to acquire input data, perform preprocessing and time period enhancement processing on the input data to obtain processed input data, and input the processed input data into the trained period enhancement Transformer model to obtain the standardized visibility forecast value for each hour in the future. The numerical conversion module is used to convert the standardized visibility forecast values for each hour in the future back to the actual physical visibility values through the inverse operation of the visibility standardization mapping. The quantitative sea fog forecasting module is used to make quantitative sea fog forecasts for target areas based on actual physical visibility values.
Citation Information
Patent Citations
A sea fog level intelligent forecasting method and system
CN114280696B
Sea fog prediction method based on machine learning
CN116796192A
Cited By
Large fog time sequence forecasting method and system for small sample scene
CN121682749A
A heavy fog time series prediction method and system for small sample scenarios
CN121682749B
Sea fog forecasting method based on cloud life cycle
CN122151258A
A sea fog forecasting method based on cloud life cycle
CN122151258B
Strait agglomerate fog full-life-cycle advanced maneuver forecasting method
CN122283981A