Methods, systems, equipment, and media for correcting second-season forecast biases based on the Swin Transformer
By using a sub-seasonal forecast bias correction method based on Swin Transformer, the problems of forecast error and systematic bias in existing technologies are solved, and high-precision correction and physical consistency of meteorological element fields are achieved. This method is applicable to forecasting tasks at global, regional and local scales.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ELECTRIC POWER RES INST OF STATE GRID ZHEJIANG ELECTRIC POWER COMAPNY
- Filing Date
- 2026-05-06
- Publication Date
- 2026-06-05
AI Technical Summary
Existing subseasonal forecasting technologies have shortcomings in nonlinear mapping capabilities, large-scale structure preservation, long-term dependency modeling, and spatial consistency assurance, leading to forecast errors and systematic biases, especially in areas with complex terrain where forecast accuracy is insufficient.
A sub-seasonal forecast bias correction method based on Swin Transformer is adopted. By combining an autoregressive Swin Transformer network with a sliding time window strategy, a correction model is constructed. A point-to-point residual correction form and a composite loss function are used to achieve accurate correction of meteorological element fields and maintain the physical consistency of large-scale circulation structure.
It improves the correction accuracy and physical consistency of local meteorological elements, reduces systematic bias and time-accumulated error in sub-seasonal forecasts, and is applicable to bias correction tasks at global, regional and local scales. It has good scalability and transferability.
Smart Images

Figure CN122151257A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of sub-seasonal forecasting technology, specifically relating to a sub-seasonal forecasting bias correction method, system, device, and medium based on Swing Transformer. Background Technology
[0002] Subseasonal forecasts, falling between short-term weather forecasts and seasonal climate predictions, have a time scale of approximately 10 to 60 days and are crucial for disaster prevention and mitigation, agricultural production, water resource management, and climate services. However, traditional numerical weather prediction models are prone to systematic biases during long-term integration. These biases primarily stem from uncertainties in physical parameterization schemes, errors in boundary conditions, and insufficient ability to describe complex terrain, leading to significant forecast errors for meteorological elements such as temperature, wind speed, and precipitation in different regions. Particularly in areas with complex terrain, the forecast accuracy of existing models often falls short of practical operational requirements.
[0003] To reduce the aforementioned systematic biases, various post-processing correction methods have been developed in the existing technology. Traditional statistical correction methods, such as linear regression and quantile mapping, can improve forecast performance to some extent, but their linear assumptions make it difficult to characterize the complex nonlinear relationships between meteorological elements, and they have poor adaptability to different meteorological models and regions. When forecast biases exhibit nonlinear characteristics, the correction effect of these methods is limited.
[0004] With the development of deep learning technology, convolutional neural network (CNN) models have been attempted for bias correction in weather forecasting. However, while CNNs have strong fitting capabilities in local feature extraction, they have inherent limitations in capturing large-scale circulation structures and long-term dependency features. Specifically, the receptive field of convolution operations is limited by the kernel size, making it difficult to effectively model long-distance spatial dependencies. Furthermore, recurrent neural networks and their variants are prone to gradient vanishing or exploding problems when processing long-sequence data, making it difficult to stably capture long-term evolutionary features on sub-seasonal timescales. In addition, existing deep learning methods often struggle to guarantee the spatial continuity and physical consistency of correction results during grid-by-grid correction, easily leading to local outliers or spatial discontinuities.
[0005] In summary, existing sub-seasonal forecast bias correction techniques still have shortcomings in terms of nonlinear mapping capabilities, large-scale structure preservation, long-term dependency modeling, and spatial consistency assurance. Summary of the Invention
[0006] Based on the aforementioned shortcomings and deficiencies in the existing technology, one of the objectives of this invention is to at least solve one or more of the aforementioned problems in the existing technology. In other words, one of the objectives of this invention is to provide a method, system, device, and medium for correcting subseasonal forecast bias based on Swin Transformer that meets one or more of the aforementioned requirements, so as to improve the correction accuracy and physical consistency of local meteorological elements while maintaining the rationality of the large-scale circulation structure, and effectively reduce the systematic bias and time-accumulated error in subseasonal forecasts.
[0007] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for correcting sub-seasonal forecast bias based on Swing Transformer, comprising the following steps: S1. Obtain the historical forecast data of the next season output by the meteorological numerical model as the training data to be corrected, and use the ERA5 reanalysis data and ground observation data as the true reference training data, and perform data preprocessing. S2. An autoregressive Swin Transformer network is combined with a sliding time window strategy to construct a correction model. The preprocessed past training data to be corrected for a preset duration is used as the input of the correction model to predict the bias field for a preset duration in the future. S3. Using a point-to-point residual correction method, based on the deviation field and the training data to be corrected, output the corrected meteorological element field. S4. Compare the corrected meteorological element field with the true reference training data, calculate the error using a composite loss function, and optimize the network weights of the correction model using a backpropagation algorithm based on the error to obtain the optimized correction model. S5. Obtain the next season's future forecast data output by the meteorological numerical model, input it into the optimized correction model, and output the corrected meteorological element field.
[0008] As a preferred embodiment, the data preprocessing in step S1 includes: The training data to be corrected and the true reference training data are organized into a tensor structure. Where B represents the data batch size, T represents the number of time steps, C represents the number of meteorological variable channels, and H and W represent the spatial longitude and latitude dimensions, respectively; For missing or anomalous grid points in the tensor structure, a masking mechanism is introduced to replace them with learnable mask tokens.
[0009] As a preferred option: The time scale of the historical forecast data and the future forecast data for the next season are both 10 to 60 days, and the resolution is 6 hours. The sliding time window strategy involves inputting training data to be corrected from the past 20 to 30 days to predict the bias field for the next 7 to 14 days.
[0010] As a preferred embodiment, the autoregressive Swin Transformer network includes: The autoregressive time series modeling module is used to capture the temporal dependencies of the training data to be corrected and obtain temporal features. The Swin Transformer spatial modeling module uses a shifted window multi-scale attention mechanism to extract spatial features from the training data to be corrected. The multivariate fusion and decoding module is used to fuse the temporal features and the spatial features and output the deviation field.
[0011] As a preferred approach, step S3 employs a point-to-point residual correction method, specifically as follows: The deviation field is added to the training data to be corrected according to their spatial locations, and the corrected meteorological element field is output.
[0012] As a preferred option, in step S4: The AdamW optimization algorithm is used to optimize network weights; The composite loss function is: , In the formula, This represents the mean square error term. Represents the average systematic deviation term. For spatial consistency constraints, , and These represent the weighting coefficients of the mean square error term, the average systematic deviation term, and the spatial consistency constraint term, respectively.
[0013] As a preferred embodiment, the following steps are also included: New ERA5 reanalysis data are acquired periodically, and the optimized correction model is retrained to form a dynamically updated correction model, which is then embedded into an operational sub-seasonal meteorological correction system.
[0014] Secondly, the present invention provides a sub-seasonal forecast bias correction system based on Swing Transformer, for implementing the sub-seasonal forecast bias correction method as described in the first aspect.
[0015] Thirdly, the present invention provides an electronic device, the computer device including a memory, a processor and a computer program, wherein when the computer program is executed by the processor, it implements the sub-seasonal forecast deviation correction method as described in the first aspect.
[0016] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the sub-seasonal forecast deviation correction method as described in the first aspect.
[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention employs the multi-scale attention mechanism of the Swing Transformer's shift window. Through a hierarchical window design, it first captures the fine local features of meteorological elements such as temperature, wind speed, and precipitation within a local window. Then, through shift window operations, it achieves information interaction between windows, thereby expanding the receptive field and enabling effective perception of large-scale circulation structures such as the subtropical high and cyclones. This adaptive local-global feature fusion method overcomes the shortcomings of traditional convolutional neural networks, such as limited receptive field and difficulty in modeling long-distance spatial dependencies. It also solves the gradient vanishing problem that recurrent neural networks are prone to when processing long sequences, enabling the correction results to maintain the inherent physical consistency of atmospheric motion while improving local accuracy.
[0018] 2. This invention employs a point-to-point residual correction method, adding the predicted bias field to the original forecast data according to their spatial locations to achieve fine-grained correction at the grid level. Compared to end-to-end methods that directly predict the final meteorological field, this mechanism preserves the large-scale circulation structure of the original numerical model output, correcting only systematic biases and avoiding the risk of compromising the rationality of large-scale physics. Simultaneously, the point-to-point grid-by-grid correction method avoids the accumulation of errors caused by interpolation or reprojection operations, ensuring the spatial accuracy of the correction results.
[0019] 3. The model architecture of this invention does not depend on a specific numerical model or geographical region. On the one hand, by replacing the input data source, the model can be adapted to the forecast output of different meteorological numerical models (such as ECMWF, GFS, etc.); on the other hand, by adjusting the spatial grid range, the model can be applied to bias correction tasks at global, regional, and even local scales. This excellent scalability gives this invention broad application prospects and transferability.
[0020] 4. This invention employs a sliding time window strategy, using historical forecast data from the past 20 to 30 days as input to predict the bias field for the next 7 to 14 days. During training, a large number of temporally overlapping sample sets are constructed through the sliding time window, enabling the model to learn the long-term evolution patterns of meteorological elements on the sub-seasonal timescale. In application, the model can use an autoregressive approach to predict window by window, effectively suppressing the cumulative effect of errors over time and improving the model's stability and generalization ability in 10 to 60-day sub-seasonal forecast tasks.
[0021] 5. The loss function of this invention integrates the mean squared error term, the average systematic bias term, and the spatial consistency constraint term. The mean squared error term ensures prediction accuracy at each grid point; the average systematic bias term specifically corrects for overall pattern drift; and the spatial consistency constraint term ensures the spatial continuity and smoothness of the correction results. The synergistic effect of these three terms allows the model to simultaneously pursue high accuracy, low bias, and physical plausibility during training, avoiding the local outliers or spatial discontinuities that may arise from traditional methods that only use the mean squared error term.
[0022] Further or more detailed beneficial effects will be described in conjunction with specific embodiments in the detailed implementation. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating the sub-seasonal forecast deviation correction method described in Embodiment 1 of the present invention.
[0025] Figure 2 This is a flowchart illustrating the output of the corrected meteorological element field as described in Embodiment 1 of the present invention.
[0026] Figure 3 This is a structural diagram of the electronic device described in Embodiment 3 of the present invention.
[0027] Icon labels: 300. Electronic devices; 301. Processor; 302. Communication bus; 303. User interface; 304. Network interface; 305. Memory. Detailed Implementation
[0028] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0029] In the following description, several embodiments of the present invention are provided. Different embodiments can be substituted or combined. Therefore, the present invention can also be considered to include all possible combinations of the same and / or different embodiments described. Thus, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present invention should also be considered to include embodiments containing one or more other possible combinations of A, B, C, and D, even if such embodiments are not explicitly described in the following text.
[0030] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of the invention. Various processes or components may be appropriately omitted, substituted, or added to the various examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
[0031] To facilitate a better understanding of the embodiments of the present invention, its application scenarios will be explained before providing a detailed explanation of the specific implementation methods.
[0032] The sub-seasonal forecast bias correction method described in the embodiments of this specification is applied to operational meteorological forecasting systems, disaster prevention and mitigation early warning platforms, agricultural production decision support systems, water resource scheduling and management platforms, and meteorological service systems in the energy industry. In these scenarios, the application of the sub-seasonal forecast bias correction method aims to reduce the systematic forecast bias of numerical models on a 10- to 60-day timescale, improve the forecast accuracy of key meteorological elements such as temperature, wind speed, and precipitation in complex terrain areas, and provide high-precision meteorological data support for early warning of severe weather, adjustment of agricultural planting structures, reservoir scheduling, and prediction of new energy power generation.
[0033] The following is a brief explanation of the sub-seasonal forecast, meteorological numerical model, ERA5 reanalysis data, ground observation data, autoregressive Swin Transformer network, point-to-point residual correction form, composite loss function, backpropagation algorithm, tensor structure, mask mechanism, mask token, shifted window multi-scale attention mechanism, and AdamW optimization algorithm involved in several embodiments of this specification: Subseasonal forecasts are meteorological forecasts with a time scale between short-term weather forecasts (usually 1 to 7 days) and seasonal climate predictions (usually more than 3 months), ranging from approximately 10 to 60 days. This time scale has important applications in disaster prevention and mitigation, agricultural planning, and water resource management, but it is also one of the more challenging time scales in numerical weather prediction because it is influenced by both initial atmospheric conditions and lower boundary conditions.
[0034] Meteorological numerical models are mathematical models that simulate and predict atmospheric conditions based on atmospheric dynamics and thermodynamic equations using computer numerical solutions. Their basic principle is to divide the forecast area into a three-dimensional grid and calculate the changes in meteorological elements such as temperature, air pressure, wind speed, and humidity over time at each grid point. The meteorological numerical model used in the embodiments of this specification is the FuXi-S2S subseasonal meteorological model, which is specifically designed and optimized for subseasonal forecasting tasks.
[0035] ERA5 reanalysis data is the fifth-generation global climate reanalysis dataset provided by the European Centre for Medium-Range Weather Forecasts (ECMWF). Reanalysis refers to the assimilation of historical observational data (including satellite, radiosonde, and ground observations) with numerical models to generate temporally continuous, spatially complete, and physically consistent meteorological data products. ERA5 data is widely used in validation and calibration tasks in meteorological research, and the embodiments in this specification use it as the reference true value for bias correction.
[0036] Ground observation data refers to real meteorological observation values obtained through ground observation equipment such as weather stations, radar, and weather balloons. Compared with reanalysis data, ground observation data has higher local accuracy, but its spatial coverage is discontinuous. The embodiments in this specification use both ground observation data and ERA5 reanalysis data as true reference data to improve the reliability and local accuracy of bias correction.
[0037] The Autoregressive Swin Transformer network is the core deep learning model constructed in the embodiments of this specification. "Autoregressive" refers to the model using prediction results from historical time steps as input for subsequent time steps to achieve long-term dependency modeling of meteorological sequences. "Swin Transformer" is a variant of Transformer based on a shifted window attention mechanism, which achieves the fusion of local features and global structure through a hierarchical window design. The network consists of an input embedding layer, a temporal modeling layer, a Swin Transformer backbone, a spatiotemporal fusion module, and an output layer.
[0038] Point-to-point residual correction refers to a correction method that adds the bias field predicted by the model to the original forecast data according to their spatial locations. The advantage of this method is that it preserves the large-scale circulation structure of the original numerical model output and only corrects the bias term, thereby avoiding the large-scale structural damage that may be caused by the deep learning model directly predicting the final result.
[0039] A composite loss function is a loss function composed of a weighted combination of loss terms with different optimization objectives. The composite loss function in the embodiments of this specification includes a mean squared error term, an average systematic bias term, and a spatial consistency constraint term. The mean squared error term measures the point-by-point prediction accuracy, the average systematic bias term corrects the overall drift of the model, and the spatial consistency constraint term ensures the spatial continuity and physical rationality of the correction results.
[0040] Backpropagation is a gradient calculation method used in deep learning to train neural networks. Its basic principle is to start from the output layer and calculate the gradient of each network parameter layer by layer based on the loss function value. Then, an optimization algorithm is used to update the network weights according to the gradient direction. In the embodiments of this specification, backpropagation is used to calculate the gradient of the composite loss function with respect to the weights of each layer of the corrected model.
[0041] Tensor structures are mathematical abstractions of multidimensional arrays, used to organize and represent high-dimensional data. In deep learning, tensors are the basic units for storing and processing data.
[0042] A masking mechanism is a technique for handling missing data. Its basic principle is to construct a mask matrix with the same shape as the original data, marking valid and missing locations within the data. During model computation, data at missing locations is either not involved in the calculation or is subject to special processing. In the embodiments of this specification, the masking mechanism is used to identify missing or anomalous grid points in a tensor structure.
[0043] Mask tokens are learnable parameter vectors used to replace missing or outlier grid points in a tensor structure. Unlike fixed-value imputation, mask tokens are continuously updated through backpropagation during model training, enabling the model to adaptively learn how to handle missing data and thus avoid additional errors that may be introduced by manual interpolation.
[0044] The shifted-window multi-scale attention mechanism is the core technology of Swin Transformer. This mechanism first divides the input feature map into non-overlapping local windows, and independently computes self-attention within each window to capture local features; then, in the next layer, the window positions are shifted (displaced) to enable information exchange between different windows, thereby expanding the receptive field; through multi-layer stacking, multi-scale feature fusion from local to global is achieved.
[0045] The AdamW optimization algorithm is a stochastic gradient optimization algorithm based on adaptive moment estimation, and is an improved version of the Adam algorithm. AdamW decouples weight decay from gradient updates, which can more effectively control model complexity and prevent overfitting.
[0046] Example 1: This embodiment provides a method for correcting sub-seasonal forecast bias based on the Swing Transformer, such as... Figure 1 As shown, the method includes the following steps: Step S1, Data Preparation: First, the historical forecast data for the next season output by the meteorological numerical model is obtained as training data to be corrected. In this embodiment, the meteorological numerical model is the FuXi-S2S sub-seasonal meteorological model, whose output sub-seasonal historical forecast data has a time scale of 10 to 60 days, a temporal resolution of 6 hours, and a spatial resolution of 0.25°. It includes upper-air variables (geopotential height, temperature, zonal wind, meridional wind, specific humidity), surface variables (2-meter temperature, 2-meter dew point temperature, 10-meter zonal wind, 10-meter meridional wind, 100-meter zonal wind, 100-meter meridional wind, sea surface temperature, mean sea level pressure), cloud cover variables (low cloud cover, middle cloud cover, high cloud cover, total cloud cover), radiation variables (surface downward solar radiation, surface net solar radiation, surface total direct solar radiation, top-of-atmosphere net longwave radiation), precipitation variables (total precipitation), and humidity variables (relative humidity), as detailed in Table 1.
[0047] Simultaneously, ERA5 reanalysis data and ground observation data were acquired as true reference training data. ERA5 reanalysis data is the fifth-generation global climate reanalysis dataset provided by the European Centre for Medium-Range Weather Forecasts (ECMWF), and in this embodiment, it is used as the true reference for bias correction. Ground observation data, including meteorological station observation data and radar observation data, were used to assist in verification.
[0048] The preprocessing of the acquired training data to be corrected and the ground truth reference training data includes: The training data to be corrected and the true reference training data are organized into a tensor structure. Where B represents the data batch size, T represents the time step, C represents the number of meteorological variable channels, and H and W represent the spatial latitude and longitude dimensions, respectively.
[0049] For missing or outlier grid points in the tensor structure, a masking mechanism is introduced, replacing them with learnable mask tokens. This mechanism allows the model to adaptively handle spatially sparse data during training, avoiding the additional errors that may be introduced by manual interpolation in traditional methods.
[0050] In addition, spatial interpolation, temporal synchronization, and standardization are performed on the input data to ensure that data from different sources remain consistent in space and time.
[0051] Table 1:
[0052] Step S2, Model Building and Bias Prediction: An autoregressive Swin Transformer network combined with a sliding time window strategy is used to construct a correction model. The sliding time window strategy is as follows: input the training data to be corrected from the past 20 to 30 days, and predict the bias field for the next 7 to 14 days.
[0053] like Figure 2 As shown, the autoregressive Swin Transformer network comprises three core modules: an autoregressive temporal modeling module, a Swin Transformer spatial modeling module, and a multivariate fusion and decoding module. Specifically, the input embedding layer divides the preprocessed meteorological tensor into non-overlapping patches (e.g., a 4×4 grid), flattens them, maps them to a fixed dimension, and generates a token sequence. The temporal modeling layer introduces an autoregressive structure to model the meteorological sequence, extracts the long-term dependency features of meteorological elements, and recursively generates future time-step inputs.
[0054] Specifically, the preprocessed past training data to be corrected for a predetermined duration is used as the input to the correction model. The autoregressive time series modeling module captures the long-term dependence of meteorological variables on the sub-seasonal time scale to obtain temporal features. The Swin Transformer spatial modeling module uses a shifted window multi-scale attention mechanism to extract spatial features from the training data to be corrected to obtain spatial features. Finally, the multivariate fusion and decoding module fuses the temporal features and the spatial features to output the bias field for a predetermined future duration.
[0055] The Swin Transformer spatial modeling module employs a hierarchical window attention mechanism. It first calculates attention within a local window to capture local meteorological features, and then uses a shifting window operation to achieve information interaction between windows, thereby expanding the receptive field and enabling perception of the global circulation structure.
[0056] After the feature fusion stage, the model enters the decoding stage. The decoder adopts a stepwise upsampling structure (PatchExpanding), gradually restoring the original resolution through channel expansion and spatial restoration operations. The output layer uses 1×1 convolutions to map high-dimensional features to each meteorological variable channel, generating a bias prediction field, i.e., a bias field for a predetermined future duration.
[0057] Step S3, Point-to-point residual correction: Using a point-to-point residual correction method, the corrected meteorological element field is output based on the deviation field and the training data to be corrected.
[0058] Specifically, the bias field is added to the training data to be corrected according to their spatial locations, and the corrected meteorological element field is output. This process can be represented as: , in, This is the training data to be corrected (i.e., the original output of the model). The bias field predicted by the correction model. This is the corrected meteorological field.
[0059] This embodiment can simultaneously output the deviation correction results for multiple meteorological variables, including elements such as temperature, humidity, wind speed, air pressure, and precipitation. All output results are input to the meteorological field in a point-to-point format every 6 hours, achieving deviation correction with grid-level spatial accuracy and avoiding error accumulation caused by interpolation or reprojection.
[0060] The advantage of using point-to-point residual correction is that the large-scale circulation structure output by the original model is completely preserved, with only one bias correction term added, thus avoiding the problem of large-scale structure destruction that may be caused by the deep learning model directly predicting the final result.
[0061] Step S4, Model Optimization: The corrected meteorological element field is compared with the true reference training data, the error is calculated using a composite loss function, and the network weights of the correction model are optimized using a backpropagation algorithm based on the error to obtain the optimized correction model.
[0062] In this embodiment, the AdamW optimization algorithm is used to optimize the network weights, with an initial learning rate of 1×10⁻⁶. -4 The weight decays to 0.01.
[0063] The composite loss function is expressed as follows: , In the formula, This represents the mean square error term. Represents the average systematic deviation term. For spatial consistency constraints, , and These represent the weighting coefficients of the mean square error term, the average systematic deviation term, and the spatial consistency constraint term, respectively.
[0064] By constructing a sample set through a sliding time window, the model is continuously updated during training to achieve dynamic optimal correction.
[0065] Step S5, Application Output: Obtain the next-season future forecast data output by the meteorological numerical model, input it into the optimized correction model, and output the corrected meteorological element field.
[0066] Specifically, when it is necessary to correct the sub-seasonal forecast for the future period, the sub-seasonal future forecast data (with a time resolution of 6 hours) output by the Fuxi Sub-Seasonal Meteorological Model (FuXi-S2S) is input into the correction model that has been optimized in step S4. The model automatically outputs the corrected meteorological element field every 6 hours, including the main meteorological elements such as temperature, humidity, wind speed, air pressure, and precipitation.
[0067] The corrected meteorological element field output in this embodiment significantly improves the correction accuracy and physical consistency of local meteorological elements while maintaining the rationality of the large-scale circulation structure. Through comparative verification, this method is significantly superior to traditional linear correction methods and convolutional neural network methods in terms of the average deviation and mean square error of meteorological elements such as temperature, wind speed, and precipitation.
[0068] Example 2: This embodiment provides a subseasonal forecast bias correction system based on Swing Transformer, used to implement the subseasonal forecast bias correction method as described in Embodiment 1.
[0069] Example 3: like Figure 3 As shown, this embodiment provides an electronic device, which may include: at least one processor, at least one network interface, a user interface, a memory, and at least one communication bus.
[0070] The communication bus can be used to enable communication between the various components mentioned above.
[0071] The user interface may include buttons, and optional user interfaces may also include standard wired interfaces and wireless interfaces.
[0072] The network interface may include, but is not limited to, Bluetooth modules, NFC modules, Wi-Fi modules, etc.
[0073] The processor may include one or more processing cores. It connects various parts of the electronic device via various interfaces and lines, executing instructions, programs, code sets, or instruction sets stored in memory, and accessing data stored in memory to perform various functions and process data. Optionally, the processor can be implemented using at least one hardware form of DSP, FPGA, or PLA. The processor may integrate one or more of the following: CPU, GPU, and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor.
[0074] The memory may include RAM or ROM. Optionally, the memory may include a non-transitory computer-readable medium. The memory can be used to store instructions, programs, code, code sets, or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor. The memory, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a correction application. The processor can be used to call the correction application stored in the memory and execute the steps of the sub-season forecast deviation correction method mentioned in the foregoing embodiments.
[0075] Example 4: This embodiment provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform the above-described instructions. Figure 1 One or more steps in the illustrated embodiment. If the constituent modules of the above-described electronic device are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.
[0076] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).
[0077] Those skilled in the art will understand that all or part of the processes in the method of Embodiment 1 described above can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and the implementation scheme can be combined arbitrarily.
[0078] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0079] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0080] The above description is merely an exemplary embodiment of the present invention and should not be construed as limiting the scope of the invention. Any equivalent changes and modifications made in accordance with the teachings of this invention are still within the scope of this invention. Those skilled in the art will readily conceive of embodiments of the invention upon considering the specification and practicing the disclosure herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of the invention are defined by the claims.
Claims
1. A method for correcting sub-seasonal forecast bias based on Swing Transformer, characterized in that, Including the following steps: S1. Obtain the historical forecast data of the next season output by the meteorological numerical model as the training data to be corrected, and use the ERA5 reanalysis data and ground observation data as the true reference training data, and perform data preprocessing. S2. An autoregressive Swin Transformer network is combined with a sliding time window strategy to construct a correction model. The preprocessed past training data to be corrected for a preset duration is used as the input of the correction model to predict the bias field for a preset duration in the future. S3. Using a point-to-point residual correction method, based on the deviation field and the training data to be corrected, output the corrected meteorological element field. S4. Compare the corrected meteorological element field with the true reference training data, calculate the error using a composite loss function, and optimize the network weights of the correction model using a backpropagation algorithm based on the error to obtain the optimized correction model. S5. Obtain the next season's future forecast data output by the meteorological numerical model, input it into the optimized correction model, and output the corrected meteorological element field.
2. The sub-seasonal forecast bias correction method based on Swing Transformer according to claim 1, characterized in that, The data preprocessing in step S1 includes: The training data to be corrected and the true reference training data are organized into a tensor structure. Where B represents the data batch size, T represents the number of time steps, C represents the number of meteorological variable channels, and H and W represent the spatial longitude and latitude dimensions, respectively; For missing or anomalous grid points in the tensor structure, a masking mechanism is introduced to replace them with learnable mask tokens.
3. The sub-seasonal forecast bias correction method based on Swing Transformer according to claim 1, characterized in that: The time scale of the historical forecast data and the future forecast data for the next season are both 10 to 60 days, and the resolution is 6 hours. The sliding time window strategy involves inputting training data to be corrected from the past 20 to 30 days to predict the bias field for the next 7 to 14 days.
4. The sub-seasonal forecast bias correction method based on Swing Transformer according to claim 1, characterized in that, The autoregressive Swin Transformer network includes: The autoregressive time series modeling module is used to capture the temporal dependencies of the training data to be corrected and obtain temporal features. The Swin Transformer spatial modeling module uses a shifted window multi-scale attention mechanism to extract spatial features from the training data to be corrected. The multivariate fusion and decoding module is used to fuse the temporal features and the spatial features and output the deviation field.
5. The sub-seasonal forecast bias correction method based on Swing Transformer according to claim 1, characterized in that, Step S3 employs a point-to-point residual correction method, specifically as follows: The deviation field is added to the training data to be corrected according to their spatial locations, and the corrected meteorological element field is output.
6. The sub-seasonal forecast bias correction method based on Swing Transformer according to claim 1, characterized in that, In step S4: The AdamW optimization algorithm is used to optimize network weights; The composite loss function is: , In the formula, This represents the mean square error term. Represents the average systematic deviation term. For spatial consistency constraints, , and These represent the weighting coefficients of the mean square error term, the average systematic deviation term, and the spatial consistency constraint term, respectively.
7. The sub-seasonal forecast bias correction method based on Swing Transformer according to claim 1, characterized in that, It also includes the following steps: New ERA5 reanalysis data are acquired periodically, and the optimized correction model is retrained to form a dynamically updated correction model, which is then embedded into an operational sub-seasonal meteorological correction system.
8. A sub-seasonal forecast bias correction system based on Swing Transformer, characterized in that, Used to implement the sub-season forecast bias correction method as described in any one of claims 1 to 7.
9. A computer device, the computer device comprising a memory, a processor, and a computer program, characterized in that, When the computer program is executed by the processor, it implements the sub-seasonal forecast deviation correction method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the sub-seasonal forecast deviation correction method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Sub-season rainfall weather forecast correction method based on U-Net network
CN113344290A
Extreme rainfall sub-season forecasting method based on multi-modal fusion improved deep learning
CN118051878A
Sub-seasonal air temperature forecast correction method based on 3D-Times Net
CN118735082A
Intelligent thunderstorm weather forecasting method and system and medium
CN120993524A
Myocardial transmembrane potential segmented time sequence reconstruction method based on physical information neural network
CN121581112A