A method and system for correcting near-surface meteorological element forecast bias based on CNN-Transformer

By extracting the spatial structure features of the meteorological field and capturing global dependencies using the CNN-Transformer model, the problem of forecast bias of meteorological elements in numerical weather prediction of complex terrain areas is solved, and the forecast accuracy of meteorological elements is significantly improved.

CN122388397APending Publication Date: 2026-07-14NANTONG INST OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANTONG INST OF TECH
Filing Date
2026-04-13
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing numerical weather prediction methods exhibit significant systematic biases in forecasting near-surface meteorological elements in complex terrain regions, and traditional statistical methods struggle to accurately describe the complex nonlinear relationships between meteorological elements.

Method used

A CNN-Transformer-based approach is adopted to extract the spatial structure features of the meteorological field through a convolutional neural network, and to capture the global dependencies between meteorological elements by using the Transformer structure to construct a multi-dimensional input feature set for bias correction.

Benefits of technology

It significantly reduces the systematic bias of numerical weather forecasts and improves the forecast accuracy of near-surface meteorological elements such as temperature, wind speed and relative humidity, especially showing a high accuracy improvement effect in complex terrain areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122388397A_ABST
    Figure CN122388397A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of meteorological forecast data processing, and discloses a near-surface meteorological element forecast deviation correction method and system based on a CNN-Transformer. The method comprises the following steps: firstly, acquiring numerical weather prediction mode output data and corresponding observation data, and performing data preprocessing; taking numerical prediction elements as input features, and taking the difference between observation values and prediction values as training labels to construct training samples; constructing a multi-dimensional input feature set containing meteorological element features, time features and space features through feature screening; constructing a CNN-Transformer model, wherein a convolutional neural network is used to extract meteorological field space features, and a Transformer is used to model global dependence relationships; obtaining a deviation correction model through training, correcting the numerical weather prediction result, and outputting corrected grid meteorological elements. Compared with the prior art, the application can effectively improve the prediction accuracy of near-surface meteorological elements in complex terrain regions, and has good application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of meteorological forecasting technology, and in particular relates to a method and system for correcting forecast biases of near-surface meteorological elements based on CNN-Transformer. Background Technology

[0002] Numerical Weather Prediction (NWP) is an important technique in modern meteorological forecasting, simulating future weather changes by solving atmospheric dynamics and thermodynamic equations. With the development of data assimilation techniques, multi-source observation data fusion, and high-performance computing, NWP has made significant progress in large-scale weather system simulation and medium-range weather forecasting.

[0003] However, at the regional scale, especially in areas with complex topography, numerical weather prediction models often exhibit significant systematic biases in their forecasts of near-surface meteorological elements (such as temperature, relative humidity, and wind speed) due to factors such as pronounced topographic relief, complex underlying surface types, and limited numerical model resolution. In areas with complex topography, the thermal differences between mountains and plains, as well as the blocking effect of topography, significantly influence local wind, temperature, and humidity fields, making it difficult for numerical models to accurately characterize changes in local meteorological elements.

[0004] To reduce numerical weather prediction errors, researchers have proposed various post-processing methods, such as Model Output Statistical (MOS), Kalman filtering, and error correction methods based on statistical regression. However, traditional statistical methods typically rely on pre-defined functional relationships, making it difficult to accurately describe the complex nonlinear relationships between meteorological elements. In recent years, machine learning and deep learning methods have been increasingly applied to the field of numerical weather prediction bias correction. For example, models such as Random Forest and Long Short-Term Memory (LSTM) networks have achieved certain results in meteorological forecast post-processing. Convolutional Neural Networks (CNNs) can effectively extract the spatial structure features of meteorological fields, while the Transformer structure has significant advantages in capturing long-range dependencies and time-series features.

[0005] However, existing research mostly focuses on correction methods for single meteorological elements or single spatial scales, and research on gridded correction of multiple meteorological elements in complex terrain regions remains relatively insufficient. Therefore, this invention provides a method and system for correcting near-surface meteorological element forecast biases based on CNN-Transformer. Summary of the Invention

[0006] The purpose of this invention is to solve the problems in the prior art, and to propose a method and system for correcting near-surface meteorological element forecast bias based on CNN-Transformer.

[0007] This invention first discloses a method for correcting forecast biases of near-surface meteorological elements based on CNN-Transformer, comprising the following steps: S1: Obtain the forecast data output by the numerical weather prediction model and the observation data corresponding to the forecast data, preprocess the forecast data and the observation data to obtain gridded meteorological data with uniform spatial resolution; S2: Construct training samples, using meteorological elements in the forecast data as input features and the deviation between the observed data and the forecast data as labels; S3: Perform feature filtering on meteorological variables and construct a multidimensional input feature set, which includes meteorological element features, temporal features and spatial features; S4: Construct a CNN-Transformer bias correction model, the model including: (1) A convolutional neural network module is used to extract spatial features from the input grid meteorological data and output a dimension-reduced spatial feature map; (2) Feature reconstruction module, used to reconstruct the spatial feature map into a sequence form; (3) The Transformer module is used to model the global dependency relationship of the reconstructed sequence and extract spatiotemporal coupling features; (4) Output module, used to generate deviation correction results based on the spatiotemporal coupling characteristics; S5: Use the training samples to train the CNN-Transformer bias correction model, optimize the model parameters, and obtain the trained bias correction model; S6: Input the numerical weather forecast data to be corrected into the trained bias correction model and output the corrected gridded meteorological element field.

[0008] In the above method, in step S1, the preprocessing includes: cropping the data according to the target area, using spatial interpolation to unify the data to the target resolution, extracting the target meteorological elements, and normalizing each meteorological element.

[0009] In the above method, in step S2, the deviation is the difference between the observed value and the predicted value at the same spatiotemporal location.

[0010] In the above method, in step S3, a correlation analysis method is used to screen meteorological variables that have a correlation with the target meteorological element that meets a preset threshold, and the meteorological element features are constructed; a periodic mapping method is used to encode the time features and spatial features, and the time features and spatial features are constructed.

[0011] In the above method, the periodic mapping method includes: using sine and cosine functions to encode time and spatial features to eliminate discontinuities at periodic boundaries.

[0012] In the above method, in step S4, the convolutional neural network module includes multiple two-dimensional convolutional layers and downsampling layers, which are used to extract the spatial structure features of the meteorological field layer by layer and reduce the spatial resolution of the feature map; the feature reconstruction module expands the dimensionality-reduced spatial feature map into a sequence form along the spatial dimension; the Transformer module includes a multi-head self-attention layer and a feedforward network layer, which are used to capture the global dependencies between different spatial locations.

[0013] In the above method, in step S5, the model is trained using an adaptive moment estimation optimization algorithm or a variant thereof, and a smooth L1 loss function is used as the objective function.

[0014] In the above method, in step S6, the near-surface meteorological elements include at least one of air temperature, wind speed, and relative humidity.

[0015] Secondly, the present invention provides a near-surface meteorological element forecast bias correction system based on CNN-Transformer, used to implement the above method, including: The data acquisition and preprocessing module is used to acquire the forecast data output by the numerical weather prediction model and the observation data corresponding to the forecast data, and to preprocess the data to obtain gridded meteorological data with uniform spatial resolution. The sample construction module is used to construct training samples by using meteorological elements in the forecast data as input features and the deviation between the observed data and the forecast data as labels. The feature construction module is used to filter the features of meteorological variables and construct a multidimensional input feature set, which includes meteorological element features, temporal features and spatial features. The model building module is used to build a CNN-Transformer bias correction model, which includes a convolutional neural network module, a feature reconstruction module, a Transformer module, and an output module. The model training module is used to train the CNN-Transformer bias correction model using the training samples, optimize the model parameters, and obtain the trained bias correction model. The bias correction module is used to input the numerical weather forecast data to be corrected into the trained bias correction model and output the corrected gridded meteorological element field.

[0016] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0017] The beneficial effects of this invention are as follows: by extracting the spatial structure features of the meteorological field through convolutional neural networks, the model's ability to express the impact of complex terrain is improved; by using the Transformer structure to capture the global dependencies between meteorological elements, the ability to model spatiotemporal features is improved; by combining spatial feature extraction with global dependency modeling, the systematic bias of numerical weather forecasts can be significantly reduced; and it shows a high accuracy improvement effect in the forecasting of near-surface meteorological elements such as temperature, wind speed, and relative humidity. Attached Figure Description

[0018] Figure 1 This is a flowchart of the method for correcting near-surface meteorological element forecast bias in complex terrain areas based on CNN-Transformer, according to the present invention. Figure 2 This is a schematic diagram of the Transformer model structure; Figure 3 This is a schematic diagram of the self-attention mechanism structure; Figure 4 This is a schematic diagram of spatial feature extraction using a convolutional neural network; Figure 5 This is a schematic diagram of the results of the correlation analysis of meteorological elements; Figure 6 This is a comparison chart of the MAE values ​​of t2m for different models; Figure 7 This is a comparison chart of the MAE values ​​of WSP for different models; Figure 8 This is a comparison chart of the MAE values ​​of rh2m for different models; Figure 9 This is a diagram illustrating the correction effect. Detailed Implementation

[0019] To facilitate understanding of this application and to make the aforementioned objectives, features, and advantages of this application more apparent, a detailed description of specific embodiments of this application is provided below in conjunction with the accompanying drawings. Numerous specific details are set forth in the following description to provide a thorough understanding of this application, and preferred embodiments are shown in the accompanying drawings. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application. This application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified. In the description of this application, "several" means at least one, such as one, two, etc., unless otherwise explicitly specified. It should be noted that when an element is referred to as being "fixed to" another element, it can be directly attached to the other element or there may be an intervening element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or there may be an intervening element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementations. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is only for describing particular implementations and is not intended to limit the scope of this application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0020] Reference Figures 1-9 A method for correcting forecast biases of near-surface meteorological elements based on CNN-Transformer includes the following steps: S1: Obtain the forecast data output by the numerical weather prediction model and the observation data corresponding to the forecast data, preprocess the forecast data and the observation data to obtain gridded meteorological data with uniform spatial resolution; S2: Construct training samples, using meteorological elements in the forecast data as input features and the deviation between the observed data and the forecast data as labels; S3: Perform feature filtering on meteorological variables and construct a multidimensional input feature set, which includes meteorological element features, temporal features and spatial features; S4: Construct a CNN-Transformer bias correction model, the model including: (1) A convolutional neural network module is used to extract spatial features from the input grid meteorological data and output a dimension-reduced spatial feature map; (2) Feature reconstruction module, used to reconstruct the spatial feature map into a sequence form; (3) The Transformer module is used to model the global dependency relationship of the reconstructed sequence and extract spatiotemporal coupling features; (4) Output module, used to generate deviation correction results based on the spatiotemporal coupling characteristics; S5: Use the training samples to train the CNN-Transformer bias correction model, optimize the model parameters, and obtain the trained bias correction model; S6: Input the numerical weather forecast data to be corrected into the trained bias correction model and output the corrected gridded meteorological element field.

[0021] This method extracts the local spatial structure features of the meteorological field through a convolutional neural network and captures global dependencies through a Transformer, thereby effectively correcting the biases of numerical weather prediction systems. Compared with traditional statistical methods and single-structure deep learning methods, it can significantly reduce the forecast errors of near-surface meteorological elements such as temperature, wind speed, and relative humidity.

[0022] Furthermore, based on the above method, the preprocessing process in step S1 is specifically defined. In this embodiment, preprocessing includes: regional cropping of the data according to the target area, unifying the data to the target resolution using spatial interpolation methods, extracting target meteorological elements, and normalizing each meteorological element. In specific implementation, the latitude and longitude range of the study area is first determined, and grid data within this range is cropped from the original numerical forecast data. Since the resolution of the original data may not meet the research needs, bilinear interpolation or cubic spline interpolation methods are used to unify the spatial resolution to the target resolution, for example, 0.125°×0.125°. Variables related to near-surface meteorological elements are extracted from the processed data, including surface layer variables and isobaric surface layer variables. All input variables are normalized, scaling the numerical range of each variable to the [0,1] interval or the [-1,1] interval to eliminate the influence of dimensional differences between different variables on model training. This preprocessing method ensures the consistency of input data in spatial resolution, providing a standardized data foundation for subsequent model training, while avoiding the model convergence difficulties caused by differences in units.

[0023] Furthermore, based on the above method, the deviation label in step S2 is specifically defined. In this embodiment, the deviation is the difference between the observed value and the forecast value at the same spatiotemporal location. Specifically, for each grid point and each time point, the numerical model forecast value at that location and the corresponding observed value are extracted. The deviation value is obtained by subtracting the forecast value from the observed value, and this deviation value serves as the training label for that sample. This deviation label represents the systematic deviation of the numerical model at that spatiotemporal location. The model corrects the deviation of the original forecast results by learning the mapping relationship between forecast features and deviation. Compared to directly learning the absolute values ​​of meteorological elements, learning the deviation value allows the model to focus more on error features, reduces modeling difficulty, and avoids violating the physical constraints of numerical forecasting itself.

[0024] Furthermore, based on the above method, the feature construction method in step S3 is specifically defined. In this embodiment, a correlation analysis method is used to screen meteorological variables whose correlation with the target meteorological element meets a preset threshold, thus constructing the meteorological element features; a periodic mapping method is used to encode the temporal and spatial features, thus constructing the temporal and spatial features. In specific implementation, firstly, the correlation coefficient between each candidate meteorological variable and the target meteorological element is calculated. Pearson correlation coefficient or Spearman correlation coefficient can be used. Based on the magnitude of the correlation coefficient, variables with high correlation are screened, redundant variables and low-correlation variables are eliminated, and a meteorological element feature set is constructed. For temporal features, the day of the year is extracted; for spatial features, the latitude and longitude information of the grid points are extracted. Since temporal and spatial features are periodic, a periodic mapping method is used for encoding, mapping the original features to a periodic continuous space. This feature construction method reduces the redundancy of input features, improves the training efficiency and generalization ability of the model, and preserves the periodic nature of temporal and spatial features through periodic mapping encoding.

[0025] More preferably, when encoding temporal and spatial features using a periodic mapping method, sine and cosine functions are used to encode the temporal and spatial features to eliminate discontinuities at periodic boundaries. Specifically, for temporal features, the day of the year is converted into an angular representation, and the sine and cosine values ​​of that angle are calculated as two input features, ensuring continuous variation of feature values ​​at time boundaries, such as between the last day and the first day of the year. For spatial features, latitude and longitude are converted into radians, and their sine and cosine values ​​are calculated, ensuring continuous feature values ​​at spatial boundaries. This encoding method effectively solves the problem of jumps in periodic variables at boundaries, enabling the model to correctly learn the changing patterns of periodic variables and improving the modeling accuracy of temporal and spatial periodicity.

[0026] Furthermore, based on the above method, the specific structure of the CNN-Transformer model in step S4 is defined. In this embodiment, the convolutional neural network module includes multiple layers of two-dimensional convolutional layers and downsampling layers, used to extract the spatial structure features of the meteorological field layer by layer and reduce the spatial resolution of the feature map; the feature reconstruction module expands the dimensionality-reduced spatial feature map into a sequence form along the spatial dimension; the Transformer module includes a multi-head self-attention layer and a feedforward network layer, used to capture the global dependencies between different spatial locations. In specific implementation, the convolutional neural network module is composed of multiple stacked convolutional blocks, each convolutional block including a two-dimensional convolutional layer, a batch normalization layer, and an activation function layer. The convolutional kernel size can be 3×3, the stride is set to 1, and the edge padding method keeps the feature map size unchanged. The downsampling layer can use max pooling or a convolution operation with a stride of 2 to gradually reduce the spatial resolution of the feature map, for example, reducing the original H×W size feature map to H / 4×W / 4 after two downsampling operations. The feature reconstruction module unfolds the feature map output by the convolutional neural network along the spatial dimension, arranging each feature vector at a spatial location sequentially to form a sequence input. The Transformer module adopts the standard Transformer encoder structure, including a multi-head self-attention layer and a feedforward network layer. The multi-head self-attention mechanism allows the model to focus on information at different locations in different representation subspaces, while the feedforward network layer performs a non-linear transformation on the attention output. This structural design enables the model to simultaneously utilize the convolutional neural network's ability to extract local spatial structure and the Transformer's ability to model global dependencies, effectively capturing the spatiotemporal coupling characteristics of meteorological elements.

[0027] Furthermore, based on the above method, the model training method in step S5 is further specified. In this embodiment, an adaptive moment estimation optimization algorithm or its variant is used to train the model, and a smooth L1 loss function is used as the objective function. Specifically, the AdamW optimization algorithm is used, and the initial learning rate is set to 1×10⁻⁶. -4 The weight decay coefficient is 3×10 -4 The batch size was set to 16, the maximum number of training epochs was set to 50, and an early stopping strategy was adopted, stopping training when the validation set loss no longer decreased after several consecutive epochs. The smoothed L1 loss function was used, which employs squared loss when the absolute error value is less than a preset threshold and linear loss when the absolute error value is greater than or equal to the threshold, combining the advantages of fast convergence of mean squared error and robustness of absolute error to outliers. This training strategy improves the stability of model training, reduces the excessive influence of extreme error samples on model parameter updates, and enables the model to maintain good generalization performance on real meteorological data containing outliers.

[0028] Furthermore, based on the above method, the meteorological elements in step S6 are defined. In this embodiment, near-surface meteorological elements include at least one of temperature, wind speed, and relative humidity. In specific implementation, a single meteorological element can be selected for correction according to actual application needs, or multiple meteorological elements can be jointly modeled and corrected simultaneously. For the deviation correction of the three key near-surface meteorological elements—temperature, wind speed, and relative humidity—corresponding correction models are established or multi-output models are constructed for synchronous prediction. This definition clarifies the application scope of the method and reflects its applicability in the field of near-surface meteorological element forecast deviation correction.

[0029] In another specific implementation, a near-surface meteorological element forecast bias correction system based on CNN-Transformer is provided. This system includes: a data acquisition and preprocessing module, used to acquire forecast data output from a numerical weather prediction model and corresponding observation data, and preprocess the data to obtain gridded meteorological data with uniform spatial resolution; a sample construction module, used to construct training samples using meteorological elements in the forecast data as input features and the bias between the observation data and the forecast data as labels; and a feature construction module, used to perform feature filtering on meteorological variables and construct a multi-dimensional input feature set. The multidimensional input feature set includes meteorological element features, temporal features, and spatial features; the model building module is used to construct a CNN-Transformer bias correction model, which includes a convolutional neural network module, a feature reconstruction module, a Transformer module, and an output module; the model training module is used to train the CNN-Transformer bias correction model using the training samples, optimize the model parameters, and obtain the trained bias correction model; the bias correction module is used to input the numerical weather forecast data to be corrected into the trained bias correction model and output the corrected gridded meteorological element field. The functions of each module in this system correspond to the steps of the aforementioned method. The modular design facilitates the deployment and maintenance of the system and can be used for integrated applications in meteorological forecasting operational systems.

[0030] In another specific embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the program performs the steps described in any of the foregoing methods. The storage medium can be a non-volatile storage medium such as ROM, RAM, hard disk, solid-state drive, or optical disk. By loading and executing the program in the storage medium, a near-surface meteorological element forecast deviation correction function based on CNN-Transformer can be implemented on a general-purpose computing device, facilitating the promotion and application of this technical solution.

[0031] The technical features in the above embodiments can be combined and used in combination without contradicting each other. In specific implementation, appropriate technical solutions can be selected based on the actual application scenario and data characteristics. Through the implementation of the above methods, systems, and storage media, the systematic bias in near-surface meteorological element forecasts of numerical weather prediction can be effectively reduced, and forecast accuracy can be improved, making it particularly suitable for meteorological forecasting operations in complex terrain areas.

[0032] Example For ease of description, this embodiment uses a specific region as the study area, located in North China. This region exhibits a topography that slopes from northwest to southeast, with complex terrain including mountains, plains, and hills, which significantly influences the spatial distribution of near-surface meteorological elements. The specific implementation steps of this method are as follows: Step 1: Obtain the output data of the European Centre for Medium-Range Weather Forecasts (ECMWF) numerical weather prediction model and the corresponding surface meteorological observation data, and preprocess the obtained numerical weather prediction data and observation data.

[0033] The ECMWF model data includes various meteorological elements at the surface and isobaric levels. Surface layer variables include: 2-meter air temperature (t2m), 2-meter dew point temperature (td2m), 10-meter U-wind component (u10m), 10-meter V-wind component (v10m), total cloud cover (tcdc), total precipitable water (tcwv), and sea level pressure (prmsl). Isobaric layer variables include: 850hPa air temperature and 500hPa geopotential height. Numerical forecast data is stored in NetCDF format and downloaded via a meteorological data interface.

[0034] The preprocessing process specifically includes the following steps: (1) The ECMWF data was cropped according to the study area to extract grid data within the Beijing-Tianjin-Hebei region. The study area is: 113°30′~119°50′ east longitude and 36°00′~42°40′ north latitude.

[0035] (2) The spatial resolution of the original ECMWF data was increased to 0.125°×0.125° by using cubic spline interpolation.

[0036] (3) Calculate derived variables based on basic meteorological variables. This mainly involves the derivation of 10-meter wind speed and 2-meter relative humidity. The 10-meter wind speed is obtained from the formula:

[0037] in, Indicates the 10-meter U-force component. The wind component V represents 10 meters; the relative humidity at 2 meters is obtained from the formula:

[0038] in, This indicates the dew point temperature at 2 meters. This indicates the temperature at 2 meters. This represents the saturated water vapor pressure function. (4) Eliminate the difference in dimensions between different variables and normalize all input variables to scale their numerical range to [0,1].

[0039] Step 2: Construct training samples by matching numerical model forecast data with corresponding observation data according to time and spatial location. For each grid point sample: the input features are the set of numerical model forecast variables, and the output is the label. bias = observation – forecast Where observation is the observed value, forecast is the numerical model forecast value, and bias is the target bias of model learning.

[0040] Step 3: Input feature selection and construction. Spearman correlation analysis is used to select variables, improving model efficiency and reducing variable redundancy, such as... Figure 5 As shown. The formula for calculating the Spearman correlation coefficient is:

[0041] in: It is the total number of samples. The first one obtained by sorting Positional deviation between paired samples.

[0042] Correlation analysis was used to select 10 meteorological elements with high correlation to the target variable from multiple meteorological variables as model input features. In addition, the following auxiliary features were introduced: sin(doy), cos(doy), sin(lat), cos(lat), sin(lon), cos(lon), where doy represents the day of the year, lat represents latitude, and lon represents longitude. A sine-cosine mapping method was used to convert periodic variables into continuous features to eliminate discontinuities caused by periodic boundaries.

[0043] Step 4: Construct the CNN-Transformer bias correction model, which includes the following steps.

[0044] (1): Input four-dimensional tensor data: ), where: B is the sample batch size, H is the number of latitude grid points, W is the number of longitude grid points, and C is the number of input features.

[0045] (2): CNN spatial feature extraction. The model first extracts the spatial structure features of the meteorological field through a convolutional neural network. The convolution operation formula is:

[0046] Where W represents the convolution kernel weights, and b is the bias term. The CNN module consists of multiple layers of two-dimensional convolutions, and the feature map spatial size is gradually reduced through downsampling operations. After two downsampling operations, the spatial resolution is reduced from H×W to H / 4×W / 4.

[0047] (3): Transformer global dependency modeling expands the CNN output feature map into a sequence form and inputs it into the Transformer encoder. The calculation formula for the Transformer self-attention mechanism is:

[0048] in , , This is a learnable parameter matrix. A multi-head attention mechanism is used to capture the dependencies between different spatial locations.

[0049] (4): Decoding and Output. The Transformer output feature sequence is restored to a spatial feature map, and then restored to the original grid resolution through deconvolution and bilinear interpolation. Finally, a bias correction result is generated through a convolutional layer. The output dimension is H×W×1, representing the prediction bias correction value for each grid point.

[0050] Step 5: Model training. The model training parameters can be set according to the table below: Table 1 Model Training Parameters

[0051] The Smooth L1 loss function is formally defined as follows:

[0052] Where the predicted value is set to The actual value is The error is .

[0053] Step Six: Meteorological Element Bias Correction. The trained CNN-Transformer model is applied to the numerical weather prediction results to correct biases in the following meteorological elements: near-surface air temperature, wind speed, and relative humidity. The corrected gridded meteorological element field is output. The corrected meteorological element results can effectively reduce the systematic error of numerical weather prediction and improve the accuracy of meteorological element forecasts in complex terrain areas. The correction results are compared with other models, and the error indices are shown in Table 2.

[0054] Table 2 Model Correction Error Comparison Table

[0055] The accuracy improvement of this model compared to other models is shown in Table 3.

[0056] Table 3 Comparison of Model Accuracy Improvement

[0057] MAE between predicted and observed values ​​for each element, such as Figures 6 to 8 As shown in the diagram. The correction effect is illustrated in the following figure. Figure 9 As shown, the original EC grid data is corrected using the trained CNN-Transformer model to obtain the corrected data. As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative and not exhaustive. All modifications within the scope of this invention or its equivalents are included in this invention.

Claims

1. A method for correcting forecast biases of near-surface meteorological elements based on CNN-Transformer, characterized in that, Includes the following steps: S1: Obtain the forecast data output by the numerical weather prediction model and the observation data corresponding to the forecast data, preprocess the forecast data and the observation data to obtain gridded meteorological data with uniform spatial resolution; S2: Construct training samples, using meteorological elements in the forecast data as input features and the deviation between the observed data and the forecast data as labels; S3: Perform feature screening on meteorological variables and construct a multidimensional input feature set, which includes meteorological element features, temporal features and spatial features; S4: Construct a CNN-Transformer bias correction model, the model including: (1) A convolutional neural network module is used to extract spatial features from the input grid meteorological data and output a dimension-reduced spatial feature map; (2) Feature reconstruction module, used to reconstruct the spatial feature map into a sequence form; (3) The Transformer module is used to model the global dependency relationship of the reconstructed sequence and extract spatiotemporal coupling features; (4) Output module, used to generate deviation correction results based on the spatiotemporal coupling characteristics; S5: Use the training samples to train the CNN-Transformer bias correction model, optimize the model parameters, and obtain the trained bias correction model; S6: Input the numerical weather forecast data to be corrected into the trained bias correction model and output the corrected gridded meteorological element field.

2. The method according to claim 1, characterized in that, In step S1, the preprocessing includes: cropping the data according to the target area, using spatial interpolation to unify the data to the target resolution, extracting the target meteorological elements, and normalizing each meteorological element.

3. The method according to claim 1, characterized in that, In step S2, the deviation is the difference between the observed value and the predicted value at the same spatiotemporal location.

4. The method according to claim 1, characterized in that, In step S3, a correlation analysis method is used to screen meteorological variables that have a correlation with the target meteorological element that meets a preset threshold, and the meteorological element features are constructed; a periodic mapping method is used to encode the temporal and spatial features, and the temporal and spatial features are constructed.

5. The method according to claim 4, characterized in that, The periodic mapping method includes: using sine and cosine functions to encode time and spatial features to eliminate discontinuities at periodic boundaries.

6. The method according to claim 1, characterized in that, In step S4, the convolutional neural network module includes multiple two-dimensional convolutional layers and downsampling layers, which are used to extract the spatial structure features of the meteorological field layer by layer and reduce the spatial resolution of the feature map; the feature reconstruction module expands the dimensionality-reduced spatial feature map into a sequence form along the spatial dimension; the Transformer module includes a multi-head self-attention layer and a feedforward network layer, which are used to capture the global dependencies between different spatial locations.

7. The method according to claim 1, characterized in that, In step S5, the model is trained using an adaptive moment estimation optimization algorithm or a variant thereof, with a smooth L1 loss function as the objective function.

8. The method according to claim 1, characterized in that, In step S6, the near-surface meteorological elements include at least one of temperature, wind speed, and relative humidity.

9. A near-surface meteorological element forecast bias correction system based on CNN-Transformer, used to implement any one of the methods described in claims 1 to 8, characterized in that, include: The data acquisition and preprocessing module is used to acquire the forecast data output by the numerical weather prediction model and the observation data corresponding to the forecast data, and to preprocess the data to obtain gridded meteorological data with uniform spatial resolution. The sample construction module is used to construct training samples by using meteorological elements in the forecast data as input features and the deviation between the observed data and the forecast data as labels. The feature construction module is used to filter the features of meteorological variables and construct a multidimensional input feature set, which includes meteorological element features, temporal features and spatial features. The model building module is used to build a CNN-Transformer bias correction model, which includes a convolutional neural network module, a feature reconstruction module, a Transformer module, and an output module. The model training module is used to train the CNN-Transformer bias correction model using the training samples, optimize the model parameters, and obtain the trained bias correction model. The bias correction module is used to input the numerical weather forecast data to be corrected into the trained bias correction model and output the corrected gridded meteorological element field.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1 to 8.