Meteorological data time-space downscaling method based on generative adversarial network
By integrating spatial and temporal downscaling modules into an adversarial generative network, introducing attention mechanisms and residual connections, and using multiple loss functions for optimization, the problems of high model complexity and insufficient feature similarity in existing technologies are solved, and efficient spatiotemporal downscaling of meteorological data is achieved.
Patent Information
- Application Number
- CN202510691316.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-11-07
AI Technical Summary
Existing adversarial generative networks (GANs) suffer from several problems when performing spatial downscaling of meteorological data. These problems include the discriminator accepting real values as prior experience, leading to information leakage; high model complexity; and the loss function only considering distribution consistency while ignoring structural and feature similarity.
By integrating spatial and temporal downscaling modules, introducing attention mechanisms and residual connections, a spatiotemporal downscaling adversarial generative network is constructed. Adversarial loss, content loss, and perceptual loss functions are used to optimize the generator and discriminator through zero-shot generalization and transfer learning.
It reduces model complexity, improves feature extraction capabilities, generates high-resolution images that are closer to the real values, and has strong robustness and generalization ability.
Smart Images

Figure CN120912920A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of meteorology and artificial intelligence, and in particular to a meteorological data space-time downscaling method based on a generative adversarial network. BACKGROUND
[0002] With the continuous development of meteorological observation technology, more and more high-precision observation data are obtained in the process of analyzing meteorological data. For example, Chen et al. (2024) proposed a MSG-SE-GAN generative adversarial network for meteorological data space downscaling, proving the application value of the generative adversarial network in meteorological data space downscaling. However, there are the following problems: 1. The discriminator accepts the true value as prior experience, which may cause information leakage; 2. The generator generates an intermediate output for each bottom module, and the discriminator accepts an intermediate input for each bottom module, which increases the complexity of the model; 3. The loss function used by the model is bulldozer loss, which only considers the distribution consistency between the generator result and the real image, and does not consider the structural similarity, brightness similarity, feature similarity and spatial correlation coefficient between images, and the two data with consistent distribution may have quite different contents corresponding to each time and each grid. SUMMARY
[0003] In order to solve the above problems in the prior art, the purpose of the present application is to provide a meteorological data space-time downscaling method based on a generative adversarial network, which fuses a space and time downscaling module, introduces an attention mechanism and a residual connection, reduces the complexity and improves the feature extraction capability.
[0004] The technical scheme adopted by the application to solve the technical problems is:
[0005] A meteorological data space-time downscaling method based on a generative adversarial network is provided, comprising the following steps:
[0006] S1: obtaining high-resolution grid images of a certain space region in a certain time period, and obtaining low-resolution grid images through spatial averaging and time averaging;
[0007] S2: constructing a space-time downscaling generative adversarial network, including a generator of a space downscaling module and a time downscaling module, and a discriminator based on convolution and instance normalization, the network uses the generator to perform space-time downscaling on the low-resolution image, then the prediction result generated by the generator and the high-resolution image are put into the discriminator at the same time, and the discriminator needs to judge the source of the two images; the goal of the generator is to make the generated image close to the high-resolution image and deceive the discriminator; and the goal of the discriminator is to distinguish the source of the two images, and the goals of the generator and the discriminator are completely opposite, which is an adversarial relationship;
[0008] S3: Train the spatio-temporal downscaling generative adversarial network with the training set to obtain a better trained generator and discriminator, optimize the parameters of the generator and discriminator through back propagation, and constantly adjust the network architecture, learning rate, loss function, and optimizer to obtain a better trained generator and discriminator;
[0009] S4: Apply the generator through zero-shot generalization or transfer learning. Zero-shot generalization is applied to other low-resolution data sets for spatio-temporal downscaling (the spatial dimension and feature dimension of the low-resolution data must be the same as the training data). Transfer learning is to train the model parameters on high-resolution images of other data sets for several times and then apply them to low-resolution images.
[0010] Further, in S1, the following steps are included:
[0011] S11: Determine the target area, download the grid data of the target area at any time, determine the meteorological variables to be down-scaled, generate low-resolution data by grid averaging and time averaging, and input the low-resolution data into the generator;
[0012] The meteorological variables are required to be placed in the feature dimension according to two adjacent time periods, and the final feature dimension length of the low-resolution data should be 2 times the number of meteorological variables. At the same time, the spatial resolution of the low-resolution data is 1 / n of the high-resolution data, where n is an integer. For the high-resolution data set, the meteorological variables of the high-resolution data set are required to be placed in the feature dimension according to t consecutive time periods. The first and last time periods of the t time periods should correspond to the adjacent two time periods in the low-resolution data, and the t-2 intermediate time periods are the time periods that need to be interpolated. The final feature dimension length of the high-resolution data should be t times the number of meteorological variables. At the same time, the spatial resolution of the high-resolution data is n times the spatial resolution of the low-resolution data, where n is an integer;
[0013] S12: Standardize the time dimension of the high-resolution data and the low-resolution data, and fill in all missing values by linear interpolation or directly assign them to 0.
[0014] S13: Combine the high-resolution data and the corresponding low-resolution data, and divide them into training set and test set.
[0015] Further, in S2, the following steps are included:
[0016] S21: The generator accepts low-resolution input, goes through the upsampling layer, the convolution layer, the Relu activation layer, the attention layer, the deep convolution layer, and uses the residual architecture to prevent gradient disappearance, and finally the high-resolution data output by the generator has the same length in each dimension as the original high-resolution data;
[0017] S22: The discriminator accepts the output value of the generator and the original resolution data as input, goes through convolution, Relu activation, instance normalization, average pooling, batch normalization, etc., and finally outputs 1 or 0, where 1 represents that the input image is a real image, and 0 represents that the input image is the output of the generator.
[0018] Further, in S21, the input and output steps of the generator are:
[0019] Upsampling layer -> (3*3 convolution layer, Relu activation layer) *2 -> attention layer -> (upsampling layer -> (3*3 convolution layer -> Relu activation layer) *2) *N -> 3*3 convolution layer -> Leaky Relu activation layer -> (3*3 convolution layer -> Leaky Relu activation layer -> 3*3 convolution layer) *N -> (1*1 convolution layer -> 3*3 deep convolution layer -> attention layer -> 1*1 convolution layer) *N -> (3*3 convolution layer -> Leaky Relu activation layer) *2;
[0020] Where the role of the convolution layer is feature extraction; the role of the Relu and Leaky Relu activation layers is to perform nonlinear activation on linear data; the attention layer achieves dynamic weight distribution between channels through the "squeeze" and "excite" steps; the deep convolution layer and the convolution have basically the same role, but each input channel of the deep convolution layer independently performs convolution, greatly reducing the computational complexity and the number of parameters; 1*1 and 3*3 before the convolution layer represent the size of the convolution kernel, and each part in the parentheses represents a small module, and *N after the parentheses represents that the module can be used repeatedly N times according to the situation; In the (3*3 convolution layer -> Leaky Relu activation layer -> 3*3 convolution layer) *N module and the (1*1 convolution layer -> 3*3 deep convolution layer -> attention layer -> 1*1 convolution layer) *N module, the residual architecture is used, that is, the input value of the module is finally added to the output result of the module, which can prevent gradient disappearance.
[0021] Further, in S22, the input and output steps of the discriminator are:
[0022] 3*3 convolution -> Relu activation -> (3*3 convolution -> instance normalization -> Relu activation -> 3*3 convolution -> Relu activation -> average pooling -> Relu activation) *N -> batch normalization -> 3*3 convolution -> Relu activation -> instance normalization -> 3*3 convolution -> Relu activation -> full connection;
[0023] (3*3 convolution -> instance normalization -> Relu activation -> 3*3 convolution -> Relu activation -> average pooling -> Relu activation) *N modules are followed by a residual connection, and then the output of each module is directly added to the output of the last Relu activation layer, and then the output is obtained after full connection.
[0024] Among them, the average pooling is used for feature extraction and dimension reduction; the batch normalization helps the model to keep stable during the training process by calculating the standard deviation within the small batch; the instance normalization is normalized on each channel of each sample, which reduces the statistical difference within the sample; the full connection layer is used for deep inference; the residual connection can ensure that the information of each resolution data can be captured by the full connection layer.
[0025] Further, in S3, the loss function of the generator includes an adversarial loss, a content loss, and a perceptual loss;
[0026] The formula of the adversarial loss is:
[0027] L G =-log(D(G(x)))
[0028] Where x represents low-resolution data, G(·) represents the generator, and D(·) represents the discriminator;
[0029] This loss represents the value output by the discriminator after the generator outputs the result after accepting the low-resolution input, and then takes the-log; if the discriminator judges the generator result as 1, then L G =0; if the discriminator judges the generator result as 0, then L G =∞; represents that if the discriminator cannot distinguish the difference between the generator output and the true value, the loss is lower, otherwise it is higher, which meets the optimization goal of the generator, that is, the generated high-resolution image should be infinitely close to the real high-resolution image;
[0030] The content loss is one of the mean absolute error MAE, the structural similarity index SSIM, and the Pearson correlation coefficient R;
[0031] The perceptual loss puts the high-resolution image output by the generator and the original high-resolution image into a visual geometry group Vgg network, which is composed of (3*3 convolution -> batch normalization -> Relu activation -> max pooling) *N. This network is used to extract image features, and finally the similarity between the generator output image and the original image features after the Vgg network is calculated. The similarity of the two images is still calculated using MAE, and finally the three loss functions are added together as the final total loss function for back propagation.
[0032] Specifically,
[0033]
[0034] where n is the number of samples, y i is the true value, is the generator predicted value, MAE represents the average of the difference between the predicted value and the true value of all samples;
[0035]
[0036] where n is the number of samples, y i is the true value, is the generator predicted value, and μ y represent the mean of the generator predicted value and the true value, and represent the variance of the generator predicted value and the true value, represent the covariance between the generator predicted value and the true value, C1 and C2 are small constants for stability, and SSIM represents the similarity between two images;
[0037]
[0038] where n is the number of samples, y i is the true value, is the generator predicted value, and μ y represent the mean of the generator predicted value and the true value, R represents the degree of linear correlation between two variables;
[0039] For the three loss functions of the content loss, they can be used alone or in combination; note that both SSIM and R are larger values representing better model performance, so when used as loss functions, (1-SSIM) and (1-R) should be used.
[0040] Further, in S3, the discriminator adversarial loss formula is:
[0041] L D =-log(D(y))-log(1-D(G(x)))
[0042] where x represents low-resolution data, y represents high-resolution data, and the loss represents the result of the discriminator after the generator output and the true value are input to the discriminator; if the discriminator discriminates the generator result as 0 and the true value as 1, then L G =0; if the discriminator discriminates the generator result as 1 and the true value as 0, then L G=∞; represents the loss is lower if the discriminator can identify the difference between the generator output and the real value, and vice versa, which meets the optimization goal of the discriminator, that is, the discriminator can identify the difference between the generator output value and the real value. The loss function is opposite to the adversarial loss of the generator, which embodies the adversariness of the adversarial generation network.
[0043] Specifically, after selecting an appropriate loss function, it is necessary to test the effect of different depth models in the spatio-temporal downscaling task. In S2, the module (i.e., the module outside the parentheses with *N) can be used multiple times to control the network depth. The larger the value of N, the deeper the network. In theory, if the model is too shallow, it is easy to underfit, which makes it difficult to reduce the loss function of the training set, that is, the model cannot well fit the real value; while if the model is too deep, it is easy to overfit, which leads to a lower loss function of the training set, but the generalization ability of the model on the test set is poor. Therefore, it is very important to select the appropriate network depth by testing the loss function performance of the test set.
[0044] The learning rate controls the magnitude of parameter update after each backpropagation. The larger the learning rate, the greater the magnitude of parameter update. A larger learning rate can cause the parameter to update too quickly and even miss the optimal solution; while a smaller learning rate can cause the convergence speed to be too slow. Therefore, it is very important to select the appropriate learning rate, which needs to be selected according to the performance of the loss function of the test set.
[0045] The optimizer controls the parameter update strategy, and the commonly used optimizers are stochastic gradient descent (SGD) and Adam optimizer. The learning rate of the SGD optimizer is the same for each update, that is, the update magnitude is the same; while Adam uses a learning rate decay strategy, so the update magnitude becomes smaller and smaller. Usually, Adam optimizer is used because it has a larger learning rate at the beginning of training, which greatly updates the parameters and saves training cost, and has a smaller learning rate at the later stage of training, which updates the parameters with a small magnitude, so that the network parameters can easily reach the optimal solution.
[0046] Selecting an appropriate batch size (the amount of data put in each training); when the video memory is sufficient, the larger the batch size, the faster the training. Selecting an appropriate number of training epochs (epochs); fewer epochs can cause the network to underfit, while more epochs can cause the network to overfit. Since the task of the discriminator is a classification problem, and the task of the generator is a regression problem, the regression problem is more difficult to fit than the classification problem, that is, the training of the generator is more difficult than the training of the discriminator, so the discriminator is trained once, and the generator is trained n times.
[0047] Further, when the network is trained, first put the low-resolution data into the generator to obtain generated data, then put the generated data into the discriminator for training, and finally put the low-resolution data into the generator to fit the high-resolution data, the above process is repeated for epochs, that is, the discriminator and the generator are trained separately, the generator is trained again each time the discriminator is trained, and the process is repeated.
[0048] Further, the adversarial generative network is applied by means of transfer learning, first find the high-resolution data set which is consistent with the data distribution of the low-resolution data which needs to be down-scaled in space and time, specifically, the consistency of the data distribution can be compared by drawing the probability density function distribution diagram of the two data; then train several times to tens of times on the high-resolution data set to fine-tune the parameters of the adversarial generative network;
[0049] Alternatively, the adversarial generative network is applied by means of zero-shot generalization, which needs to have low-resolution data.
[0050] Further, in the application stage, the generator part of the adversarial generative network is saved, and the discriminator part is directly discarded;
[0051] The low-resolution data which needs to be down-scaled in space and time is put into the feature dimension according to the processing method in the training, that is, the high-resolution data can be output. The M*T and M*T+T-1 features of the output high-resolution data feature dimension are the same time. Wherein M represents the Mth feature, and T represents the middle generated time+2 of each feature of the high-resolution data; actually, only the time between M*T to M*T+T-2 or M*T+1 to M*T+T-1 is needed, and finally the T-1 time corresponding to each feature is flattened and fused with the time dimension, so that the final high-resolution data sequence is obtained.
[0052] Compared with the prior art, the beneficial effects of the present application are as follows:
[0053] 1. The meteorological data space-time down-scaling method based on the adversarial generative network of the present application fuses the space and time down-scaling modules, and introduces the attention mechanism and the residual connection, thereby reducing the complexity of the model and improving the feature extraction capability.
[0054] 2. The meteorological data space-time down-scaling method based on the adversarial generative network of the present application, the loss function of the generator includes an adversarial loss, a content loss and a perception loss, by adding the three loss functions, the overall structural consistency (perception loss) and the detail consistency (content loss) of the generated data and the true value are considered; compared with the bulldozer loss of the original model, only the overall distribution consistency of the generated data and the true data is considered, and the generated data is closer to the true value in detail;
[0055] 3. The meteorological data spatiotemporal downscaling method based on the adversarial generative network according to the example of the application can directly zero-sample generalize and migrate learning, is suitable for CMIP6 low-resolution data, and the network has strong robustness. BRIEF DESCRIPTION OF DRAWINGS
[0056] Other features, objects and advantages of the application will become more apparent from the following detailed description of non-limiting embodiments, made with reference to the attached drawings:
[0057] Figure 1 is a flowchart of the application;
[0058] Figure 2 is a schematic diagram of the framework of the adversarial generative network;
[0059] Figure 3 is a flowchart of the attention layer;
[0060] Figure 4 is the result of spatiotemporal downscaling identification of Typhoon Kompasu in 2010 on ERA5 data in the example;
[0061] Figure 5 is the result of spatiotemporal downscaling identification of Typhoon Kompasu in 2010 on CMIP6 data in the example. DETAILED DESCRIPTION
[0062] The application will be further described in detail below with reference to the drawings and examples. It can be understood that the specific examples described herein are only used to explain the related application, and not to limit the application. In addition, it should be noted that only the parts related to the application are shown in the drawings for ease of description.
[0063] It should be noted that the examples in the application and the features in the examples can be combined with each other without conflict. The application will be described in detail below with reference to the drawings and in combination with the examples.
[0064] Example 1:
[0065] This embodiment is recommended to be implemented in a small server with the following configuration: AMD Ryzen Threadripper PRO5975WX processor, main frequency 3.6GHz, 32 cores (or other processors supporting maximum 512GB and above memory); NVIDIA GeForce RTX 4090 graphics card, 24GB of video memory (or other NVIDIA graphics cards with video memory greater than or equal to 24GB); memory 512GB; storage space 18TB and above. The implementation of the spatiotemporal downscaling adversarial generative network is based on the Tensorflow 2.10 deep learning framework toolkit.
[0066] AsFigure 1 FIG. 1 shows a flowchart of a method for spatiotemporal downscaling of meteorological data based on a generative adversarial network, comprising the following steps:
[0067] S1: Obtain high-resolution grid images of a certain spatial region in a certain time period, obtain low-resolution grid images by spatial averaging and temporal averaging, and standardize the time dimension of the high-resolution grid images and the low-resolution grid images, and divide the data into a training set and a test set.
[0068] The specific steps are as follows:
[0069] S11: Determine the target region: In this example, the target region is from 5.0°S to 53.0°N, 93.0°E to -173°W, with a spatial resolution of 0.5°. The fifth-generation ECMWF reanalysis dataset from the European Centre for Medium-Range Weather Forecasts is used to download the variable (in this example, the mean sea level pressure SLP) that needs to be spatiotemporally downscaled for any time period (in this example, from 1980 to 2014, with a time resolution of 6 hours), obtaining high-resolution data with dimensions (T, H, W, M) (in this example, (51132, 116, 188, 1));
[0070] The downloaded high-resolution data is preprocessed, and each n grid point is averaged to obtain one value, and each t time data is smoothed to obtain one value, thereby obtaining low-resolution data (in this example, n is 2 and t is 5). The dimensions of the low-resolution data are (T, H / n, W / n, M) (in this example, (51132, 58, 94, 1)). The adjacent two time of low-resolution data are fused into the last dimension to obtain new low-resolution data with dimensions (T, H / n, W / n, 2*M) (in this example, (51132, 58, 94, 2)); the continuous t time of high-resolution data are fused into the last dimension to obtain new high-resolution data with dimensions (T, H, W, M*t) (in this example, (51132, 116, 188, 5)).
[0071] S12: Standardize the time dimension of the high-resolution data and the low-resolution data, and simultaneously perform linear interpolation processing to fill in all missing values, or directly assign a value of 0;
[0072] S13: Combine the high-resolution data and the corresponding low-resolution data, and divide them into a training set and a test set. In this example, the ratio of the training set to the test set is 8:2, i.e., 40906 data as the training set and 10226 data as the test set.
[0073] S2: Constructing the spatio-temporal downscaling generative adversarial network, including the generator containing the spatial downscaling module and the temporal downscaling module, and the discriminator based on convolution and instance normalization;
[0074] As shown in Figure 2 , Figure 2 The upper half of the generator belongs to the spatial downscaling module, and the lower half belongs to the temporal downscaling module. The network uses the generator to perform spatio-temporal downscaling on the low-resolution image, and then the prediction result generated by the generator and the high-resolution image are put into the discriminator at the same time, and the discriminator needs to judge the source of the two images. The goal of the generator is to make the generated image close to the high-resolution image and deceive the discriminator; while the goal of the discriminator is to distinguish the source of the two images. The goals of the generator and the discriminator are completely opposite, and they are in an adversarial relationship.
[0075] The specific steps are as follows:
[0076] S21: The adversarial generative network is divided into two parts, the generator and the discriminator. The generator accepts low-resolution input, and then goes through the up-sampling layer→3*3 convolution layer→Relu activation layer)*2→attention layer→(up-sampling layer→(3*3 convolution layer→Relu activation layer)*2)*3→3*3 convolution layer→Leaky Relu activation layer→(3*3 convolution layer, Leaky Relu activation layer, 3*3 convolution layer)*3→(1*1 convolution layer→3*3 deep convolution layer→attention layer→1*1 convolution layer)*2→(3*3 convolution layer→Leaky Relu activation layer)*2; The role of the convolution layer is feature extraction; the role of the Relu and Leaky Relu activation layers is to perform nonlinear activation on linear data (the Relu function can also be replaced by the Tanh function, etc.); the attention layer realizes dynamic weight distribution between channels through the two steps of "squeeze" and "excitation"; the deep convolution layer and the convolution have basically the same role, but each input channel of the deep convolution layer independently performs convolution, greatly reducing the computational complexity and the number of parameters; 1*1 and 3*3, etc. before the convolution layer represent the size of the convolution kernel, and each part in the parentheses represents a small module. The *N after the parentheses represents that the module can be used repeatedly N times according to the situation. In the (3*3 convolution layer→Leaky Relu activation layer→3*3 convolution layer)*N module and the (1*1 convolution layer→3*3 deep convolution layer→attention layer→1*1 convolution layer)*N module, the residual architecture is used, that is, the input value of the module is finally added to the output result of the module. This step can prevent gradient disappearance, and the dimensions of the high-resolution data output by the final generator are the same as the lengths of the dimensions of the original high-resolution data. In this embodiment, the flowchart of the attention layer is as shown in Figure 3 .
[0077] S22: The discriminator accepts the output value of the generator and the original high-resolution data as input. After 3*3 convolution -> Relu activation -> (3*3 convolution -> instance normalization -> Relu activation -> 3*3 convolution -> Relu activation -> average pooling -> Relu activation) * 3 -> batch normalization -> 3*3 convolution -> Relu activation -> instance normalization -> 3*3 convolution -> Relu activation -> full connection. Among them, the average pooling is used for feature extraction and dimension reduction; the batch normalization helps the model to keep stable during the training process by calculating the standard deviation within the small batch; the instance normalization is normalized on each channel of each sample respectively, which reduces the statistical difference within the sample; the full connection layer is used for deep inference. After the (3*3 convolution -> instance normalization -> Relu activation -> 3*3 convolution -> Relu activation -> average pooling -> Relu activation) * N module, there is a residual connection to add the output of each module directly to the input of the last Relu activation, which can ensure that the information of each resolution data can be captured by the full connection layer. Finally, the discriminator outputs 1 or 0, where 1 represents that the input image is a real image, and 0 represents that the input image is the output of the generator.
[0078] S3: Different network architectures, learning rates, loss functions and optimizers are selected, and the spatio-temporal downscaling generative adversarial network is trained using the training set. The parameters of the generator and the discriminator are optimized through back propagation. By monitoring the loss function value changes of the training set and the test set in real time, the network architecture, learning rate, loss function and optimizer are adjusted to obtain a better trained generator and discriminator.
[0079] The specific steps are as follows:
[0080] S31: The loss function of the generator of the network is composed of three parts, which are the adversarial loss, the content loss and the perception loss.
[0081] The formula of the adversarial loss is:
[0082] L G =-log(D(G(x)))
[0083] Where x represents low-resolution data, G(·) represents the generator, and D(·) represents the discriminator.
[0084] This loss represents the output value of the generator after accepting the low-resolution input, which is put into the discriminator and then output. If the discriminator judges the generator result as 1, then L G = 0; if the discriminator judges the generator result as 0, then L G=∞; represents that if the discriminator cannot distinguish the difference between the generator output and the true value, the loss is lower, otherwise it is higher, which meets the optimization goal of the generator, that is, the generated high-resolution image should be infinitely close to the true high-resolution image;
[0085] The content loss is one of mean absolute error (MAE), structural similarity index (SSIM) and Pearson correlation coefficient (R);
[0086]
[0087] Wherein, n is the sample quantity, y i is the true value, is the generator prediction value, and MAE represents the average of the difference between the prediction value and the true value of all samples;
[0088]
[0089] Wherein, y i is the true value, is the generator prediction value, and μ y represent the mean of the generator prediction value and the true value, and represent the variance of the generator prediction value and the true value, represent the covariance between the generator prediction value and the true value, C1 and C2 are small constants for stability, and SSIM represents the similarity between two images;
[0090]
[0091] Wherein, y i is the true value, is the generator prediction value, and μ y represent the mean of the generator prediction value and the true value, and R represents the linear correlation between the two variables;
[0092] In this embodiment, the weighted average of the above three loss functions is used, and the weights of the three loss functions are (SSIM: 1, R: 1, MAE: 0.01) respectively;
[0093] The perceptual loss puts the high-resolution image output by the generator and the original high-resolution image into a visual geometry group (Vgg) network together, and in this embodiment, the Vgg network is composed of (3*3 convolution→batch normalization→Relu activation→max pooling)*2. The network is used to extract image features, and finally the similarity between the generator output image and the original image features after passing through the Vgg network is calculated, and the similarity of the two images is still calculated using MAE;
[0094] The last three loss functions are added together as the final total loss function for backpropagation; in this example, the weights of the adversarial loss, the content loss, and the perceptual loss are 0.005, 1, and 1, respectively.
[0095] The discriminator loss function of the network is relatively simple and only consists of an adversarial loss. The formula for the discriminator adversarial loss is:
[0096] L D = -log(D(y)) - log(1 - D(G(x)))
[0097] where x represents low-resolution data and y represents high-resolution data.
[0098] This loss represents the result of the discriminator when the generator output and the real value are input to the discriminator; if the discriminator discriminates the generator result as 0 and the real value as 1, then L G = 0; if the discriminator discriminates the generator result as 1 and the real value as 0, then L G = ∞; if the discriminator can identify the difference between the generator output and the real value, the loss is lower, otherwise it is higher, which meets the optimization goal of the discriminator, that is, the discriminator can identify the difference between the generator output and the real value. This loss function is opposite to the adversarial loss of the generator, which embodies the adversarial nature of the adversarial generation network.
[0099] After selecting the appropriate loss function, it is necessary to test the effect of different depth models in the spatio-temporal downscaling task. In S2, the repeated use of multiple modules (i.e., modules with parentheses outside, with *N modules outside the parentheses) controls the network depth, and the larger the value of N, the deeper the network. In theory, if the model is too shallow, it is prone to underfitting, making it difficult to reduce the loss function of the training set, that is, the model cannot fit the real value well; while if the model is too deep, it is prone to overfitting, resulting in a lower loss function of the training set, but the model has poor generalization ability on the test set, so it is very important to select the appropriate network depth by testing the loss function performance on the test set.
[0100] The learning rate controls the magnitude of parameter updates after each backpropagation. The larger the learning rate, the greater the magnitude of parameter updates. A larger learning rate can cause the parameters to update too quickly and even miss the optimal solution; while a smaller learning rate can result in a slow convergence speed. Therefore, it is very important to choose the appropriate learning rate, which needs to be selected according to the performance of the loss function on the test set. In this example, after testing, the network performs better when the discriminator learning rate is 0.01 and the generator learning rate is 0.001.
[0101] The optimizer controls the strategy of parameter update, and the commonly used optimizers are stochastic gradient descent (SGD) and Adam optimizer. The learning rate of the SGD optimizer is the same for each update, that is, the update amplitude is the same; while the Adam uses a learning rate decay strategy, and the update amplitude becomes smaller and smaller. The Adam optimizer is usually used because it has a larger learning rate at the beginning of training, which greatly updates the parameters and saves training costs, and a smaller learning rate at the later stage of training, which updates the parameters with a small amplitude and makes the network parameters more easily reach the optimal solution. In this example, it is found through testing that the network using the Adam optimizer has better effect than that using the SGD optimizer.
[0102] A suitable batch size (the amount of data put in each time) is selected; when the video memory is sufficient, the larger the batch size, the faster the training. A suitable number of training times (epochs) is selected; too few epochs may lead to underfitting of the network, and too many epochs may lead to overfitting of the network. Since the task of the discriminator is a classification problem and the task of the generator is a regression problem, the regression problem is usually more difficult to fit than the classification problem, that is, the training of the generator is more difficult than that of the discriminator. Therefore, when the discriminator is trained once, the generator is trained n times. In this embodiment, it is found through testing that the generator is trained 10 times when the discriminator is trained once.
[0103] The trained generator is applied to the test set. In this embodiment, a process in the time coverage of the test set is selected for demonstration, that is, the sea level pressure field of Typhoon Kompasu from October 17, 2010 to October 20, 2010, as shown in FIG. 2. Figure 4 Figure 4 As shown in FIG. 2, the left column is the real value of the sea level pressure field of ERA5, and the right column is the output result of the generator. It can be found that the output result of the generator is close to the real value of ERA5 in terms of the central pressure of the typhoon, the range of the typhoon, or the high-latitude high-pressure field at each time.
[0104] S4: Using the trained generator, zero-shot generalization can be performed on other low-resolution data sets for spatio-temporal downscaling application (requiring the spatial dimension and feature dimension of the low-resolution data to be the same as the training data), or transfer learning can be performed on high-resolution images of other data sets for several times of training to fine-tune the model parameters, and then the low-resolution images are applied.
[0105] The specific steps are as follows:
[0106] If the migration ability of the model needs to be verified, other data with the same spatial range, the same spatial resolution and the required spatiotemporal downscaling variable (in this example, the mean sea level pressure SLP) in any time period need to be downloaded to obtain high-resolution data, and the length of each dimension of the data (T, H, W, M) (in this example, (51132, 116, 188, 1)) is obtained. If the model needs to be applied only to low-resolution data, other data with the same spatial range, the same spatial resolution and the required spatiotemporal downscaling variable in any time period need to be downloaded.
[0107] If the migration ability of the model needs to be verified, the downloaded high-resolution data needs to be preprocessed, and each n grid point is averaged to obtain one value, and each t time data is moving average to obtain one value, so as to obtain low-resolution data (in this example, n is 2, and t is 5). The length of each dimension of the low-resolution data is (T, H / n, W / n, M) (in this example, (51132, 58, 94, 1)). The continuous t times of high-resolution data are fused into the last dimension to obtain the length of each dimension of the new high-resolution data (T, H, W, M*t) (in this example, (51132, 116, 188, 5)).
[0108] The two adjacent times of low-resolution data are fused into the last dimension to obtain the length of each dimension of the new low-resolution data (T, H / n, W / n, 2*M) (in this example, (51132, 58, 94, 2)).
[0109] The time dimension of the high-resolution data (only used when verifying the migration ability of the model, not needed when directly applied) and the low-resolution data is standardized, and all missing values can be linearly interpolated or directly assigned to 0. The high-resolution data (only used when verifying the migration ability of the model, not needed when directly applied) and the corresponding low-resolution data are combined and divided into a training set and a test set. In this example, the proportion of the training set and the test set is 8:2, that is, 40906 data are used as the training set, and 10226 data are used as the test set.
[0110] If the generative adversarial network is applied through transfer learning, the generative adversarial network needs to be parameter fine-tuned for several to tens of times on the high-resolution data set; if the generative adversarial network is applied through zero-shot generalization, only the low-resolution data is needed. In this example, the zero-shot generalization form is used for testing.
[0111] During the non-training phase, only the generator part of the Generative Adversarial Network (GAN) needs to be saved, while the discriminator part is discarded. This is because only the generator part involves spatiotemporal downscaling; the discriminator's role is merely to help the generator improve during training. The low-resolution data requiring spatiotemporal downscaling is directly processed according to the training method, placing it into the feature dimension at two adjacent time points to output high-resolution data. The M*T and M*T+T-1th features of the output high-resolution data feature dimension are at the same time point, where M represents the Mth feature and T represents the intermediate generation time point of each feature in the high-resolution data + 2. In practice, only the time points between M*T and M*T+T-2 or M*T+1 and M*T+T-1 need to be taken. Finally, by flattening the T-1 time points corresponding to each feature and fusing them with the time dimension, the final high-resolution data sequence is obtained.
[0112] To verify the model's transferability, the generated high-resolution data can be compared with real high-resolution data. This example uses the sea-level pressure field of Typhoon Nuri from October 16th to October 19th, 2010, from the CNRM-CM6-1-HR data of CMIP6. Figure 5 As shown. Figure 5 In the image, the left column shows the actual sea level pressure field values of CNRM-CM6-1-HR, while the right column shows the generator output. It can be observed that at various time points, regardless of the magnitude of the typhoon's central pressure, its extent, or the high-latitude high-pressure field, the generator's output values are quite close to the actual CNRM-CM6-1-HR values.
[0113] This embodiment exemplifies a spatiotemporal downscaling method for meteorological data based on adversarial generative networks, such as... Figure 4 As shown, the model demonstrates excellent performance on the sea level pressure field test set of ERA5, and can generalize to the low-resolution data of CMIP6 with zero samples without additional model training. Figure 5 As shown, it still exhibits excellent performance. The model used in this embodiment only requires about 7 days to train 100 times on an NVIDIA RTX 4090 graphics card, and in later testing, inferring 10226 time-cycles of data takes less than 1 minute.
[0114] Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-mentioned technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-mentioned technical features or their equivalent features without departing from the inventive concept. For example, technical solutions formed by substituting the above-mentioned features with technical features disclosed in this application (but not limited to) that have similar functions.
Claims
1. An adversarial generative network based spatiotemporal downscaling method for meteorological data, characterized in that, The method comprises the following steps: S1: obtaining high-resolution grid images of a certain space region in a certain time period, and obtaining low-resolution grid images through spatial averaging and time averaging; S2: constructing a spatio-temporal downscaling generative adversarial network, including a generator containing a spatial downscaling module and a temporal downscaling module, and a discriminator based on convolution and instance normalization; S3: training the spatio-temporal downscaling generative adversarial network by using a training set to obtain an optimized trained generator and discriminator; S4: applying the generator through zero-shot generalization or transfer learning. 2.The weather data spatiotemporal downscaling method based on a generative adversarial network according to claim 1, wherein, In S1, the following steps are included: S11: determining a target research region, downloading grid data of the target region in any time period, determining meteorological variables to be down-scaled, generating low-resolution data through grid averaging and time averaging, and taking the low-resolution data as input values of the generator; S12: standardizing the time dimensions of high-resolution data and low-resolution data, and simultaneously performing linear interpolation processing to fill in all missing values; S13: combining the high-resolution data and the corresponding low-resolution data, and dividing them into a training set and a test set. 3.The weather data spatiotemporal downscaling method based on a generative adversarial network according to claim 1, wherein, In S2, the following steps are included: S21: the generator accepts low-resolution input, and passes through an up-sampling layer, a convolution layer, a Relu activation layer, an attention layer, a deep convolution layer, and uses a residual architecture to prevent gradient disappearance, and finally the high-resolution data output by the generator has the same length in each dimension as the original high-resolution data; S22: the discriminator accepts the output values of the generator and the original resolution data as inputs, and passes through convolution, Relu activation, instance normalization, average pooling, batch normalization, etc., and finally outputs 1 or 0, wherein 1 represents that the input image is a real image, and 0 represents that the input image is the output of the generator.
4. The weather data spatio-temporal downscaling method based on the generative adversarial network according to claim 3, characterized in that, In S21, the input and output steps of the generator are as follows: Up-sampling layer→(3*3 convolution layer, Relu activation layer)*2→attention layer→(up-sampling layer→(3*3 convolution layer→Relu activation layer)*2)*N→3*3 convolution layer→Leaky Relu activation layer→(3*3 convolution layer→Leaky Relu activation layer→3*3 convolution layer)*N→(1*1 convolution layer→3*3 deep convolution layer→attention layer→1*1 convolution layer)*N→(3*3 convolution layer→Leaky Relu activation layer)*2.
5. The method of claim 3, wherein, In S22, the input and output steps of the discriminator are as follows: 3*3 convolution→Relu activation→(3*3 convolution→instance normalization→Relu activation→3*3 convolution→Relu activation→average pooling→Relu activation)*N→batch normalization→3*3 convolution→Relu activation→instance normalization→3*3 convolution→Relu activation→full connection; There is a residual connection after the (3*3 convolution→instance normalization→Relu activation→3*3 convolution→Relu activation→average pooling→Relu activation)*N module, and then the output of each module is directly added to the output of the last Relu activation layer, and then full connection is performed to output. 6.The weather data spatiotemporal downscaling method based on a generative adversarial network according to claim 1, wherein, In S3, the loss function of the generator includes an adversarial loss, a content loss, and a perception loss. The formula of the adversarial loss is: L G = -log(D(G(x))) Wherein, x represents low resolution data, G(·) represents a generator, and D(·) represents a discriminator; The content loss is one of a mean absolute error (MAE), a structural similarity index (SSIM), and a Pearson correlation coefficient (R). The perceptual loss puts the high-resolution image output by the generator and the original high-resolution image into a visual geometry group (Vgg) network together, and the Vgg network is composed of (3*3 convolution→batch normalization→Relu activation→max pooling)*N.
7. The method and apparatus for spatiotemporal downscaling of meteorological data based on a generative adversarial network according to claim 1, wherein, In S3, the formula of the discriminator adversarial loss is: L D = -log(D(y)) - log(1 - D(G(x))) Wherein, x represents low resolution data, and y represents high resolution data.
8. The weather data spatio-temporal downscaling method based on a generative adversarial network according to claim 1, characterized in that, During network training, the low resolution data is first put into the generator to obtain generated data, then the generated data is put into the discriminator for training, and finally the low resolution data is put into the generator to fit the high resolution data, and the above process is repeated for epochs times. 9.The weather data spatiotemporal downscaling method based on a generative adversarial network of claim 1, wherein, The adversarial generative network is applied through transfer learning, first a high resolution data set with a data distribution consistent with the low resolution data that needs to be spatially and temporally down-scaled is found, specifically, whether the data distributions of the two data are consistent can be compared by drawing a probability density function distribution graph; then the adversarial generative network is fine-tuned for several to tens of times on the high resolution data set; Alternatively, the adversarial generative network is applied through zero-shot generalization, and needs to have low resolution data.
10. The method of claim 1, wherein, In the application stage, the generator part of the adversarial generative network is saved, and the discriminator part is directly discarded; The low resolution data that needs to be spatially and temporally down-scaled is put into the feature dimension according to the processing method during training according to two adjacent time periods, and the high resolution data can be output.