Rainfall data high-precision downscaling method based on terrain fusion and residual optimization
By employing terrain fusion and residual optimization methods, and utilizing a random forest regression model and terrain factors, the problems of multi-source data scale mismatch and loss of complex terrain features in precipitation data downscaling were solved, achieving high-precision and efficient precipitation data processing to meet meteorological and hydrological early warning needs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA RE CATASTROPHE RISK MANAGEMENT CO LTD
- Filing Date
- 2025-12-08
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies suffer from problems such as multi-source data scale mismatch, loss of complex terrain features, and low computational efficiency in the process of downscaling precipitation data, making it difficult to meet the accuracy, efficiency, and stability requirements of meteorology, hydrology, and disaster early warning fields.
By employing terrain fusion and residual optimization methods, and utilizing a random forest regression model combined with terrain factors, high-precision downscaling of precipitation data is achieved. This includes dynamic normalization of terrain factors, block processing, and residual correction, along with matching local mean scaling, to construct high-precision precipitation prediction results.
It improves the accuracy and efficiency of precipitation data, better supports meteorological early warning and hydrological simulation, reduces errors and adapts to different terrain scenarios, and improves computational efficiency and stability.
Smart Images

Figure CN121958950A_ABST
Abstract
Description
High-precision downscaling method for precipitation data based on terrain fusion and residual optimization Technical Field
[0001] This invention relates to the field of precipitation analysis technology, specifically to a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization. Background Technology
[0002] In the fields of meteorology, hydrology, and disaster early warning, obtaining high-precision, high-resolution precipitation data relies on downscaling techniques. The current mainstream approach is to fuse satellite remote sensing data with surface parameters such as topography and vegetation indices to downscale precipitation data and improve spatial resolution. However, the problem of scale mismatch between multi-source data is prominent. Satellite precipitation products and high-precision digital elevation models (DEMs) have vastly different resolutions. Existing technologies lack effective scale conversion and matching mechanisms, leading to the propagation of systematic and random errors throughout the calculation process, ultimately resulting in statistical characteristics of the downscaling results deviating from reality. Furthermore, there is insufficient adaptability to complex terrain and computational engineering capabilities. The utilization of terrain factors is static and cannot quantify the dynamic effects of terrain on precipitation. Traditional algorithms also suffer from high computational complexity, lack optimization design for large-scale data processing, and lack robust outlier protection mechanisms. This results in the loss of local precipitation characteristics in complex terrain areas and makes continuous operational operation difficult, failing to meet the timeliness requirements of disaster early warning. Therefore, existing technologies are insufficient to meet the requirements of meteorology, hydrology, and disaster early warning for the accuracy, efficiency, and stability of precipitation data downscaling. Summary of the Invention
[0003] This invention provides a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization, in order to solve the problems of low accuracy and low efficiency in the existing technology for downscaling precipitation data.
[0004] In a first aspect, the present invention provides a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization. The method includes: acquiring raw precipitation data of a target area and aggregating the raw precipitation data to obtain downscaling baseline data; acquiring a digital elevation model (DEM) of the target area and marking the DEM based on the downscaling baseline data to determine the effective precipitation area of the DEM; extracting multiple topographic factors strongly correlated with precipitation distribution based on the effective precipitation area and dynamically normalizing the topographic factors to obtain standard topographic factors; constructing a random forest regression model using the downscaling baseline data as the response variable and the standard topographic factors as the explanatory variables, and using the random forest regression model to predict the target area to obtain preliminary precipitation prediction results; calculating the residual between the preliminary precipitation prediction results and the downscaling baseline data, and correcting the preliminary precipitation prediction results based on the residual to obtain intermediate precipitation prediction results; calculating the first local mean of the downscaling baseline data and the second local mean of the intermediate precipitation prediction results, and scaling the intermediate precipitation prediction results based on the first local mean and the second local mean to obtain the final precipitation prediction results.
[0005] This invention provides a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization. By using terrain fusion and residual optimization downscaling, it solves the problems of scale mismatch in multi-source data and loss of complex terrain features in traditional techniques. It improves the precision of precipitation prediction by using a random forest model combined with terrain factors. Through residual correction and local mean scaling, it effectively controls downscaling error, significantly reducing the deviation between high-resolution precipitation data and the true value. At the same time, dynamic normalization and other designs adapt to different terrain scenarios, and block processing and other optimizations improve computational efficiency. The final output of high-precision precipitation data can better support meteorological early warning, hydrological simulation and other services.
[0006] In one alternative implementation, the resolution of the original precipitation data is 0.01°, the resolution of the downscaled baseline data is 0.05°, and the resolution of the data elevation model is 30 meters.
[0007] In one optional implementation, the terrain factors include: elevation, slope, and terrain humidity index; dynamic normalization of the terrain factors to obtain standard terrain factors includes: determining local terrain using a sliding window, calculating the elevation range and slope standard deviation based on the terrain factors, and determining the local terrain complexity based on the elevation range and slope standard deviation in conjunction with the interquartile range; determining the weights of different local terrains based on the local terrain complexity, and calculating the standard terrain factors of the target area based on the weights of different local terrains.
[0008] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided by this invention aggregates 0.01° raw precipitation data into 0.05° baseline data and matches the scale difference of a 30-meter DEM, reducing the accumulation of errors in multi-source data fusion. At the same time, it selects three core terrain factors—elevation, slope, and topographic humidity index—and determines the local terrain complexity by combining a sliding window and interquartile range. Then, it calculates standard terrain factors by weighting according to complexity, which not only preserves the precipitation correlation characteristics of complex terrain but also avoids the loss of details caused by the one-size-fits-all approach of traditional normalization, greatly improving the adaptability of terrain factors to precipitation distribution.
[0009] In one optional implementation, a random forest regression model is constructed using downscaled baseline data as the response variable and standard topographic factors as the explanatory variables. The random forest regression model is then used to predict the target area to obtain preliminary precipitation prediction results. This includes: training the random forest regression model based on downscaled baseline data of the effective precipitation area; determining the optimal parameters of the decision tree using performance saturation detection technology; constructing the random forest regression model; dividing the 30-meter resolution effective precipitation area into multiple data blocks; predicting the precipitation data of each data block using the random forest regression model; and integrating the precipitation data of each data block to obtain preliminary precipitation prediction results for the 30-meter resolution effective precipitation area.
[0010] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided by this invention trains a random forest model using effective precipitation area data and determines the optimal parameters by combining performance saturation detection, avoiding interference from invalid data and balancing model fitting accuracy and efficiency. At the same time, it divides the 30-meter area into blocks for prediction and then integrates them, which not only solves the memory occupation problem of large-scale data, but also improves the computational efficiency by utilizing the locality of data blocks. Finally, it efficiently generates preliminary precipitation prediction results with a 30-meter resolution, ensuring the refinement of the downscaled data.
[0011] In one optional implementation, the residuals between the preliminary precipitation forecast results and the downscaled baseline data are calculated, and the preliminary precipitation forecast results are corrected based on the residuals to obtain intermediate precipitation forecast results. This includes: calculating the residuals using downscaled baseline data of the effective precipitation area and the corresponding preliminary precipitation forecast results; constructing an index for each residual, calculating the interpolation weight of each residual using nearest neighbor search, and fusing the residuals with the preliminary precipitation forecast results based on the difference weights to obtain intermediate precipitation forecast results.
[0012] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided by this invention calculates residuals for effective precipitation areas, avoiding the introduction of additional errors by invalid data and improving the accuracy of residuals. By constructing a residual index and nearest neighbor search interpolation weights, the method achieves matching of residuals from the baseline scale to the 30-meter scale, and makes the residual correction more consistent with the spatial distribution pattern of precipitation. Finally, the residuals are fused with the preliminary prediction results, which effectively compensates for the bias of the model prediction, greatly improves the downscaling accuracy of precipitation data, and makes the intermediate results closer to the actual precipitation distribution.
[0013] In one optional implementation, the method involves calculating a first local mean of downscaled baseline data and a second local mean of intermediate precipitation prediction results, and scaling the intermediate precipitation prediction results based on the first and second local means to obtain a final precipitation prediction result. This includes: obtaining a first actual distance corresponding to the resolution of the downscaled baseline data and a second actual distance corresponding to the resolution of the intermediate precipitation prediction results, and determining a sliding window size based on the first and second actual distances; calculating the first local mean of the downscaled baseline data and the second local mean of the intermediate precipitation prediction results with the same sliding window size based on the sliding window size; comparing the magnitudes of the first and second local means, scaling the intermediate precipitation prediction results according to the comparison result, and simultaneously using Gaussian smoothing to eliminate noise to obtain the final precipitation prediction result.
[0014] In an optional implementation, the method further includes: overlaying administrative boundaries and latitude / longitude grids based on the resolution of the final precipitation forecast results to generate a visualization of the final precipitation forecast results.
[0015] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided by this invention determines the sliding window by matching the actual distance between the baseline data and the intermediate results, making the local mean calculation more consistent with the data scale characteristics. The total deviation of the downscaled data is calibrated based on the scaling operation of the double mean, ensuring the accuracy of the total precipitation in the local area. The superimposed Gaussian smoothing effectively eliminates interpolation noise and further improves the data accuracy. The visualization design of superimposing administrative boundaries and latitude and longitude grids makes the high-precision precipitation results more intuitive and easy to use.
[0016] Secondly, this invention provides a high-precision downscaling device for precipitation data based on terrain fusion and residual optimization. The device includes: a precipitation data downscaling module for acquiring raw precipitation data of a target area and aggregating the raw precipitation data to obtain downscaling baseline data; a terrain data processing module for acquiring a digital elevation model (DEM) of the target area and marking the DEM based on the downscaling baseline data to determine the effective precipitation area of the DEM; a terrain factor normalization module for extracting multiple terrain factors strongly correlated with precipitation distribution based on the effective precipitation area and dynamically normalizing the terrain factors to obtain standard terrain factors; and model construction. The precipitation prediction module uses downscaled baseline data as the response variable and standard topographic factors as the explanatory variable to construct a random forest regression model. This model is then used to predict precipitation in the target area, yielding preliminary precipitation prediction results. The data correction module calculates the residuals between the preliminary precipitation prediction results and the downscaled baseline data, and corrects these residuals to obtain intermediate precipitation prediction results. The local matching module calculates the first local mean of the downscaled baseline data and the second local mean of the intermediate precipitation prediction results. Based on these first and second local means, the intermediate precipitation prediction results are scaled to obtain the final precipitation prediction results.
[0017] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.
[0018] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0019] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 is a schematic diagram of an application scenario according to an embodiment of the present invention; Figure 2 is a schematic diagram of the first process of a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization according to an embodiment of the present invention; Figure 3 is a schematic diagram of the second process of a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization according to an embodiment of the present invention; Figure 4 is a structural block diagram of a high-precision downscaling device for precipitation data based on terrain fusion and residual optimization according to an embodiment of the present invention; Figure 5 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0023] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0024] As an optional application scenario of this invention, as shown in Figure 1, the high-precision downscaling system for precipitation data based on terrain fusion and residual optimization may include at least one terminal device and at least one server. Figure 1 shows, for example, that the system includes a computer 101, a mobile terminal 102 and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through the network 110.
[0025] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.
[0026] The relevant technologies suffer from three main defects: First, scale mismatch and error accumulation: Existing methods lack effective scale transformation and matching mechanisms when fusing multi-source data with significant scale differences (such as satellite precipitation products and high-precision DEMs). This direct and rigid fusion method leads to the gradual transmission and accumulation of systematic and random errors between data in the computation chain, causing deviations in the statistical characteristics of the final downscaling result and resulting in significant cumulative errors.
[0027] II. Loss of Local Features and Model Rigidity in Complex Topography: Traditional methods utilize topographic factors in a relatively singular and static manner, failing to construct a factor system capable of quantifying the dynamic effects of topography on precipitation through "enhancement-blockage-convergence." Furthermore, the standardization / normalization methods used in data preprocessing are too coarse and cannot adapt to complex and varied topography, resulting in the smoothing or erasure of fine precipitation distribution characteristics in key areas such as mountainous regions, and distortion of local precipitation totals.
[0028] III. Bottlenecks in Computational Efficiency and Engineering Deployment: High-resolution downscaling means processing massive amounts of data. Traditional residual interpolation algorithms have high computational complexity and are extremely time-consuming. In addition, the entire process lacks memory management, parallel computing, and outlier protection design for large-scale data processing, resulting in system instability and difficulty in meeting the stringent efficiency and stability requirements of continuous business operations.
[0029] To address the aforementioned issues, this invention provides a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization. By combining terrain fusion and residual optimization, the method aims to improve the accuracy and efficiency of downscaling precipitation data.
[0030] According to an embodiment of the present invention, a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0031] This embodiment provides a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization, which can be used in the computer system described above. Figure 2 is a flowchart of the high-precision downscaling method for precipitation data based on terrain fusion and residual optimization according to an embodiment of the present invention. As shown in Figure 2, the process includes the following steps: Step S201, obtain the original precipitation data of the target area and aggregate the original precipitation data to obtain downscaling baseline data.
[0032] Specifically, in the field of meteorological monitoring, the spatial precision of data is often measured using latitude and longitude. In this embodiment, the resolution of the original precipitation data is 0.01° (equivalent to a distance of approximately 1 kilometer). The original precipitation data is aggregated to a resolution of 0.05° using an average resampling method to construct downscaled baseline data. The resampling process employs multi-threaded (e.g., four-threaded) parallel processing to ensure that the statistical characteristics (such as mean and extreme values) of the aggregated precipitation data are retained at a rate exceeding 98%, avoiding information distortion. Temporary intermediate files are generated to store the aggregation results, reducing disk usage (single file storage size controlled at 50-80MB). Automatic cleanup is performed after processing, improving the efficiency of engineering deployment. The determination of the resolution of the downscaling reference data is based on the following: The goal of downscaling the geographic dimensions of the target area is to obtain precipitation data with a resolution of 30 meters. To minimize the spatial interpolation error of subsequent downscaling, the downscaling reference data needs to form a scale matching relationship of about 1:200 with the 30-meter resolution. 0.05° is approximately 5.5 kilometers, and 5.5 kilometers / 30 meters ≈ 183, which is close to an integer multiple of 200. 200 is an optimized choice that takes into account both theoretical accuracy and engineering practicality. Depending on the latitude and longitude of the target area, the matching relationship may also be 1:167. This is just an example and is not a limitation.
[0033] In some alternative implementations, the resolution of the raw precipitation data is 0.01°, the resolution of the downscaled baseline data is 0.05°, and the resolution of the data elevation model is 30 meters.
[0034] Step S202: Obtain the digital elevation model of the target area, and mark the digital elevation model based on the downscaled benchmark data to determine the effective precipitation area of the digital elevation model.
[0035] Specifically, while acquiring raw precipitation data, DEM data with a resolution of 30 meters is loaded, and invalid DEM value areas (such as areas without precipitation data) are marked. A mask for effective terrain areas is generated to determine the effective precipitation areas in the digital elevation model. The resolution of the effective precipitation areas is also 30 meters.
[0036] Step S203: Extract multiple topographic factors that are strongly correlated with precipitation distribution based on the effective precipitation area, and perform dynamic normalization on the topographic factors to obtain standard topographic factors.
[0037] Specifically, a collaborative preprocessing mechanism for terrain features is introduced. First, multi-dimensional features are extracted from DEM data based on a 30-meter resolution, extracting terrain factors strongly correlated with precipitation distribution. Principal component analysis is used to eliminate multicollinearity among features, constructing an optimal feature combination to ensure that the subsequent normalization process is based on a scientifically sound and comprehensive terrain feature system. The terrain factors are then dynamically normalized to obtain standard terrain factors.
[0038] Step S204: Using downscaled baseline data as the response variable and standard topographic factors as the explanatory variables, a random forest regression model is constructed, and the random forest regression model is used to predict the target area to obtain preliminary precipitation prediction results.
[0039] Specifically, the standard topographic factors have been precisely aligned with the downscaled baseline data at a 5-kilometer scale through resampling. The standardized multidimensional topographic features are used as input to the random forest regression model, enabling the model to directly learn the nonlinear relationship between large-scale topographic patterns and precipitation distribution. Based on the standard topographic factors at a 30-meter resolution for the target area, precipitation data at a 30-meter resolution are predicted, yielding preliminary precipitation prediction results.
[0040] Step S205: Calculate the residual between the preliminary precipitation forecast result and the downscaled baseline data, and correct the preliminary precipitation forecast result based on the residual to obtain the intermediate precipitation forecast result.
[0041] Specifically, the residuals between the original precipitation data (i.e., downscaled baseline data) at a resolution of 0.05° and the preliminary precipitation prediction results are calculated, and the residuals are reduced to within a resolution of 30 meters using inverse distance weighted interpolation (IDW). The residuals at the 30-meter resolution are then fused with the preliminary precipitation prediction results to obtain the intermediate precipitation prediction results.
[0042] Step S206: Calculate the first local mean of the downscaling baseline data and the second local mean of the intermediate precipitation prediction results, and scale the intermediate precipitation prediction results based on the first local mean and the second local mean to obtain the final precipitation prediction results.
[0043] Specifically, the first local mean of the downscaled baseline data and the second local mean of the intermediate precipitation forecast results are calculated. Local mean matching using a dynamic window ensures that the total regional amount of precipitation data at 30-meter resolution after downscaling is consistent with the original 0.05° resolution precipitation data. Spatial smoothing and effective regional masking are performed simultaneously to optimize the output results.
[0044] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided in this embodiment solves the problems of scale mismatch and loss of complex terrain features in traditional techniques by using terrain fusion and residual optimization downscaling methods. It improves the precision of precipitation prediction by using a random forest model combined with terrain factors. Through residual correction and local mean scaling, it effectively controls downscaling error and significantly reduces the deviation between high-resolution precipitation data and the true value. At the same time, dynamic normalization and other designs are adapted to different terrain scenarios, and block processing and other optimizations improve computational efficiency. The final output of high-precision precipitation data can better support meteorological early warning, hydrological simulation and other services.
[0045] This embodiment provides a high-precision downscaling method for precipitation data based on terrain fusion and residual optimization, which can be used in the aforementioned computer system. Figure 3 is a flowchart of the high-precision downscaling method for precipitation data based on terrain fusion and residual optimization according to an embodiment of the present invention. As shown in Figure 3, the process includes the following steps: Step S301, acquiring the original precipitation data of the target area and aggregating the original precipitation data to obtain downscaling baseline data. For details, please refer to step S201 of the embodiment shown in Figure 2, which will not be repeated here.
[0046] Step S302: Obtain the digital elevation model of the target area, and mark the digital elevation model based on the downscaled reference data to determine the effective precipitation area of the digital elevation model. For details, please refer to step S202 of the embodiment shown in Figure 2, which will not be repeated here.
[0047] Step S303: Extract multiple topographic factors that are strongly correlated with precipitation distribution based on the effective precipitation area, and perform dynamic normalization on the topographic factors to obtain standard topographic factors.
[0048] Specifically, the terrain factors include: elevation, slope, and terrain humidity index. Step S303 above includes: Step S3031, using a sliding window to determine the local terrain, calculating the elevation range and slope standard deviation based on the terrain factors, and combining the interquartile range to determine the local terrain complexity based on the elevation range and slope standard deviation.
[0049] Specifically, in addition to basic features such as elevation, slope, and topographic humidity index, topographic factors also include planar curvature and profile curvature. Local topography is determined by a sliding window. For example, local topography with a resolution of 30 meters is a 30×30 grid. This is just an example, but not a limitation.
[0050] The slope calculation uses the Sobel operator to solve the terrain slope (unit: degree) by using the gradient values in the horizontal and vertical directions. During the calculation process, a minimum slope threshold (0.1 degrees) is set for areas with a slope of 0 (such as plains) to avoid the denominator being 0 in the subsequent calculation of the Topographic Wetness Index (TWI).
[0051] The topographic humidity index is calculated based on the slope value. The formula is: TWI=ln(1 / tan(slope×π / 180)), which quantifies the ability of topography to converge surface runoff and reflects the cumulative effect of precipitation in low-lying areas.
[0052] The local terrain variation coefficient for each grid point is calculated using a sliding window algorithm. A terrain complexity index is generated by combining indicators such as slope standard deviation, elevation range, and curvature intensity. More weight is assigned to complex terrain areas to ensure that the local feature retention rate of the normalized terrain factors exceeds 90%. Simultaneously, the interquartile range is used to estimate the standard deviation, reducing the impact of outliers on the normalization results (improving outlier robustness by 40%).
[0053] Step S3032: Determine the weights of different local terrains based on the complexity of each local terrain, and calculate the standard terrain factor of the target area based on the weights of different local terrains.
[0054] Specifically, instead of the traditional global mean method, a terrain complexity-weighted mean algorithm is adopted. Complex terrain areas are given higher weights to emphasize local features; flat areas use global statistics to maintain spatial consistency. The calculation formula is: Weighted Mean = (Terrain complexity weight × Local mean) / Weights.
[0055] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided in this embodiment aggregates 0.01° raw precipitation data into 0.05° baseline data and matches the scale difference of a 30-meter DEM, reducing the accumulation of errors in multi-source data fusion. At the same time, it selects three core terrain factors—elevation, slope, and topographic humidity index—and determines the local terrain complexity by combining a sliding window and interquartile range. Then, it calculates standard terrain factors by weighting according to complexity. This method not only preserves the precipitation correlation characteristics of complex terrain but also avoids the loss of details caused by the one-size-fits-all approach of traditional normalization, greatly improving the adaptability of terrain factors to precipitation distribution.
[0056] Step S304: Using downscaled baseline data as the response variable and standard topographic factors as the explanatory variables, a random forest regression model is constructed, and the random forest regression model is used to predict the target area to obtain preliminary precipitation prediction results.
[0057] Specifically, step S304 includes: step S3041, training a random forest regression model based on downscaled baseline data of effective precipitation area shadows, determining the optimal parameters of the decision tree using performance saturation detection technology, and constructing a random forest regression model.
[0058] Specifically, only downscaled baseline data with a resolution of 0.05° corresponding to the effective precipitation area are selected as training samples. Invalid areas of the DEM are removed to avoid invalid data interfering with model fitting, ensuring the reliability of the physical meaning of the training samples, and improving the sample validity rate to over 95%.
[0059] Using performance saturation detection technology, the number of decision trees and the maximum depth of decision trees are gradually increased. When the improvement in model prediction accuracy is less than a preset threshold, parameter adjustment is stopped to determine the optimal parameters. For example, the number of decision trees is 100 (when the number of decision trees increases from 50 to 100, the model validation error decreases by 12%, and further increasing the number of trees does not significantly reduce the error). The maximum depth of decision trees in complex terrain areas is 20, the maximum depth of decision trees in flat areas is 15, and the minimum number of samples per leaf node is 3 to avoid model overfitting.
[0060] Using 0.05° resolution downscaled baseline data as the response variable (i.e. the target that the model needs to predict) and standard terrain factors as explanatory variables (i.e. model input features), a random forest regression model is trained based on the selected samples and optimal parameters.
[0061] Step S3042: Divide the effective precipitation area with a resolution of 30 meters into multiple data blocks, and use a random forest regression model to predict the precipitation data of each data block.
[0062] Specifically, the effective precipitation area with a resolution of 30 meters is divided into multiple independent data blocks according to a preset size (e.g., 8192×8192 pixels) to ensure that the memory usage of a single block is controlled within 500MB (to adapt to hardware computing power) and to avoid memory overflow caused by global prediction.
[0063] The standard terrain factors corresponding to each data block are input into a pre-trained random forest regression model to predict 30-meter resolution precipitation data for each data block. By leveraging the spatial locality of data blocks (adjacent blocks have similar terrain features), some intermediate calculation results from adjacent data blocks are reused to improve prediction efficiency.
[0064] Step S3043: Integrate and process the precipitation data of each data block to obtain the preliminary precipitation prediction results of the effective precipitation area with a resolution of 30 meters.
[0065] Specifically, the prediction results of each data block are spliced together according to spatial location (latitude and longitude coordinates) to restore the complete 30-meter resolution effective precipitation area data. The continuity of precipitation data in the spliced area is checked to avoid abnormal jumps at the edges of the data blocks, and the preliminary 30-meter resolution precipitation prediction results covering the target area are obtained as the basis data for subsequent residual correction.
[0066] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided in this embodiment trains a random forest model using effective precipitation area data and determines the optimal parameters by combining performance saturation detection, avoiding interference from invalid data and balancing model fitting accuracy and efficiency. At the same time, the prediction of 30-meter area blocks is re-integrated, which not only solves the memory occupation problem of large-scale data, but also improves the computational efficiency by utilizing the locality of data blocks. Finally, it efficiently generates preliminary precipitation prediction results with a resolution of 30 meters, ensuring the refinement of the downscaled data.
[0067] Step S305: Calculate the residual between the preliminary precipitation forecast result and the downscaled baseline data, and correct the preliminary precipitation forecast result based on the residual to obtain the intermediate precipitation forecast result.
[0068] Specifically, step S305 includes: step S3051, using downscaled baseline data of the effective precipitation area to calculate the residual with the corresponding preliminary precipitation forecast results.
[0069] Specifically, the downscaled baseline data (actual precipitation reference value) at 0.05° resolution is matched one-to-one with the preliminary precipitation prediction results at 30-meter resolution, according to spatial location (within the effective precipitation area). For each corresponding spatial location, the precipitation value of the downscaled baseline data is subtracted from the precipitation value of the preliminary precipitation prediction result to obtain the residual for that location. A positive residual indicates that the predicted value is too low, and a negative residual indicates that the predicted value is too high. Only the residual data within the effective precipitation area is retained, and the residuals of invalid areas of the DEM are removed to avoid introducing interference. The residual effectiveness rate exceeds 92%.
[0070] In step S3052, an index for each residual is constructed, and the interpolation weight of each residual is calculated using nearest neighbor search. Based on the difference weight, the residuals are fused with the preliminary precipitation prediction results to obtain the intermediate precipitation prediction results.
[0071] Specifically, the residual data with a resolution of 0.05° is indexed according to spatial coordinates (e.g., KD-tree index), and the global traversal of the traditional IDW (time complexity O(n²)) is optimized into nearest neighbor search (time complexity O(nlogn)), which facilitates the rapid retrieval of nearest neighbor residual samples.
[0072] For each grid point with a resolution of 30 meters, the corresponding 0.05° scale residual sample is found through nearest neighbor search (usually 8-16 optimal neighbor points are selected), and then the interpolation weight of each residual sample is calculated based on the rule of "1 / distance²". The closer the distance, the greater the weight.
[0073] The interpolated 30-meter resolution residual is added to the corresponding preliminary precipitation prediction result to obtain the corrected intermediate precipitation prediction result, thereby compensating for the prediction bias of the random forest model.
[0074] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided in this embodiment calculates residuals for effective precipitation areas, avoiding the introduction of additional errors by invalid data and improving the accuracy of residuals. By constructing a residual index and nearest neighbor search interpolation weights, the method achieves matching of residuals from the baseline scale to the 30-meter scale, and makes the residual correction more consistent with the spatial distribution pattern of precipitation. Finally, the residuals are fused with the preliminary prediction results, which effectively compensates for the bias of the model prediction, greatly improves the downscaling accuracy of precipitation data, and makes the intermediate results closer to the actual precipitation distribution.
[0075] Step S306: Calculate the first local mean of the downscaling baseline data and the second local mean of the intermediate precipitation prediction results, and scale the intermediate precipitation prediction results based on the first local mean and the second local mean to obtain the final precipitation prediction results.
[0076] Specifically, step S306 includes: step S3061, obtaining the first actual distance corresponding to the resolution of the downscaled baseline data and the second actual distance corresponding to the resolution of the intermediate precipitation prediction results, and determining the sliding window size based on the first actual distance and the second actual distance.
[0077] Specifically, the downscaling baseline data is at a resolution of 0.05°, corresponding to the first actual distance (approximately 5.5 km near the equator, with the exact value adjusted according to the latitude of the application area); the intermediate precipitation prediction result is at a resolution of 30 meters, corresponding to the second actual distance (30 meters). Using the first actual distance as the baseline, the ratio between it and the second actual distance is calculated (e.g., 5.5 km ÷ 30 m ≈ 183). This ratio is used as the size of the sliding window (i.e., the number of 30-meter pixels covered by the window) to ensure that the window range is consistent with the spatial scale of the 0.05° baseline data, avoiding scale misalignment of local means.
[0078] Step S3062: Based on the sliding window size, calculate the first local mean of the downscaled baseline data with the same sliding window size and the second local mean of the intermediate precipitation prediction results.
[0079] Specifically, based on the sliding window size, all grids within the effective precipitation area are traversed. Within each window, the first local mean of the 0.05° downscaled baseline data (representing the actual statistical level of precipitation in that area) is calculated; simultaneously, the second local mean of the 30-meter resolution intermediate precipitation prediction results (representing the statistical level of the current prediction result) is calculated. The first and second local means corresponding to each window are recorded to provide a basis for subsequent scaling.
[0080] Step S3063: Compare the magnitudes of the first local mean and the second local mean, scale the intermediate precipitation prediction results according to the comparison results, and use Gaussian smoothing to eliminate noise to obtain the final precipitation prediction results.
[0081] Specifically, for each sliding window, the magnitudes of the first local mean and the second local mean are compared, and a scaling factor is calculated using the formula: Scaling factor = First local mean / Second local mean. The intermediate precipitation prediction result at a resolution of 30 meters within the sliding window is multiplied by the corresponding scaling factor to ensure that the total local precipitation is consistent with the downscaled baseline data, thus ensuring that the total precipitation deviation in the 5×5 km local area is controlled within 3%.
[0082] The scaled results are smoothed using a Gaussian smoothing algorithm (smoothing coefficient can be 10, adjusted according to noise intensity) to eliminate local outliers caused by interpolation or scaling. Simultaneously, based on a mask of the effective DEM region, precipitation data from invalid DEM regions are removed to ensure the physical validity of the output results (reducing the incidence of edge outliers by 75%). The processing results from all sliding windows are then integrated to obtain the final precipitation prediction result at a 30-meter resolution.
[0083] In some alternative implementations, the method further includes: overlaying administrative boundaries and latitude / longitude grids based on the resolution of the final precipitation forecast results to generate a visualization of the final precipitation forecast results.
[0084] Specifically, it outputs precipitation data with a resolution of 30 meters (using GeoTIFF format, supporting geographic coordinate positioning), simultaneously generates visualization results, overlays administrative boundaries and latitude and longitude grids (latitude and longitude grid intervals of 0.05°), and annotates time information (accurate to the hour) to meet the intuitive requirements of engineering applications.
[0085] The high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided in this embodiment determines the sliding window by matching the actual distance between the baseline data and the intermediate results, making the local mean calculation more consistent with the data scale characteristics. The total deviation of the downscaled data is calibrated based on the scaling operation of the double mean, ensuring the accuracy of the total precipitation in the local area. The superimposed Gaussian smoothing effectively eliminates interpolation noise and further improves the data accuracy. The visualization design of superimposing administrative boundaries and latitude and longitude grids makes the high-precision precipitation results more intuitive and easy to use.
[0086] In a specific embodiment, for a severe rainstorm event (maximum hourly precipitation of 85 mm), the fine precipitation analysis input is as follows: (1) Precipitation data: hourly precipitation data with a resolution of 0.01° (2 time periods, corresponding to 02:00 and 03:00, data format GeoTIFF, no data value is -9999); (2) Topographic data: 30-meter DEM (covering the entire area of a certain region, with an area of approximately 1997 square kilometers, and the proportion of areas with no data value is <2%); (3) Boundary data: administrative boundary of a certain region (vector data converted to raster, resolution 30 meters).
[0087] Based on the above input data, the processing process includes: (1) Preprocessing: 0.01° precipitation data is aggregated to 0.05°, which takes 1.5 minutes / hour, and the mean retention rate of the aggregated data is 98.5%; (2) Downscaling: topographic factor extraction, random forest modeling, and residual correction are completed. The processing time per hour is 6.5 minutes, and 30-meter resolution precipitation data is output (single file size is about 187MB); (3) Accuracy verification: compared with 20 ground rain gauges in a certain area, MAE=9.8 mm (traditional statistical downscaling MAE=17.2 mm, traditional IDWMAE=23.4 mm), and the error in complex terrain areas is reduced by 43%; (4) Visualization: a precipitation distribution map with 0.05° latitude and longitude grid is generated, which clearly shows the enhancement effect of rainstorms in mountains and the uniform distribution characteristics of plains, meeting the decision support needs of urban flooding early warning.
[0088] This embodiment utilizes downscaling of precipitation data, significantly improving accuracy. The MAE is 9.8 mm (compared to 17.2 mm for traditional statistical downscaling techniques and 23.4 mm for traditional IDW MAE), and the relative error of peak precipitation is 12% (compared to >38% for traditional techniques). Spatial consistency: Total precipitation deviation in a 5×5 km local area is <3% (compared to >12% for traditional techniques), and the goodness of fit with surface rain gauges is R²=0.89 (compared to <0.7 for traditional techniques). Terrain adaptability: Accuracy is improved by 40-45% in complex terrain areas (such as mountains and hills) and by 25-30% in flat areas, adapting to different geographical scenarios. Engineering efficiency surpasses the 30-meter grid (approximately 1.1×10⁻⁶ meters) for a 100×100 km area. 8 The actual measured efficiency of each stage (in pixels) is shown in Table 1: Table 1 Comparison of Processing Efficiency of Each Stage
[0089] In addition to improved accuracy, the high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided in this embodiment enhances robustness and engineering adaptability. Through dynamic normalization, KD-tree nearest neighbor selection, and Gaussian smoothing, the outlier rate in the edge region is reduced from 32% to 5%, significantly improving data reliability. It supports batch processing of 100+ time periods, with batch processing efficiency 20% higher than single-time period stacking (total time for 100 time periods is 6.5 hours). It has been verified in high-altitude, complex terrain, and plain scenarios, with accuracy fluctuation <8%, and can be adapted to different geographical regions.
[0090] This embodiment also provides a high-precision downscaling device for precipitation data based on terrain fusion and residual optimization. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0091] This embodiment provides a high-precision downscaling device for precipitation data based on terrain fusion and residual optimization, as shown in Figure 4. It includes a precipitation data downscaling module 401, which is used to acquire the original precipitation data of the target area and aggregate the original precipitation data to obtain downscaled baseline data.
[0092] The terrain data processing module 402 is used to acquire the digital elevation model of the target area, and to mark the digital elevation model based on the downscaled reference data to determine the effective precipitation area of the digital elevation model.
[0093] The topographic factor normalization module 403 is used to extract multiple topographic factors that are strongly correlated with precipitation distribution based on the effective precipitation area, and to perform dynamic normalization processing on the topographic factors to obtain standard topographic factors.
[0094] The model building and precipitation prediction module 404 is used to construct a random forest regression model by using downscaled baseline data as the response variable and standard topographic factors as the explanatory variables, and then use the random forest regression model to predict the target area to obtain preliminary precipitation prediction results.
[0095] The data correction module 405 is used to calculate the residual between the preliminary precipitation forecast results and the downscaled baseline data, and correct the preliminary precipitation forecast results based on the residual to obtain the intermediate precipitation forecast results.
[0096] The local matching module 406 is used to calculate the first local mean of the downscaled baseline data and the second local mean of the intermediate precipitation prediction results, and to scale the intermediate precipitation prediction results based on the first local mean and the second local mean to obtain the final precipitation prediction results.
[0097] The high-precision downscaling device for precipitation data based on terrain fusion and residual optimization provided in this invention embodiment can execute the high-precision downscaling method for precipitation data based on terrain fusion and residual optimization provided in any embodiment of this invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.
[0098] Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0099] Referring specifically to Figure 5, a schematic diagram of a suitable electronic device for implementing embodiments of the present invention is shown below. The electronic device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from memory 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0100] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 shows an electronic device with various devices, it should be understood that it is not required to implement or have all the devices shown, and more or fewer devices may be implemented or have alternatively.
[0101] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the high-precision downscaling method for precipitation data based on terrain fusion and residual optimization according to embodiments of the present invention.
[0102] The electronic device shown in Figure 5 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0103] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the high-precision downscaling method for precipitation data based on terrain fusion and residual optimization shown in the above embodiments is implemented.
[0104] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A high-precision downscaling method for precipitation data based on terrain fusion and residual optimization, characterized in that, The method includes: acquiring raw precipitation data of the target area and aggregating the raw precipitation data to obtain downscaled baseline data; acquiring a digital elevation model (DEM) of the target area and marking the DEM based on the downscaled baseline data to determine the effective precipitation area of the DEM; extracting multiple topographic factors strongly correlated with precipitation distribution based on the effective precipitation area and dynamically normalizing the topographic factors to obtain standard topographic factors; constructing a random forest regression model using the downscaled baseline data as the response variable and the standard topographic factors as the explanatory variables, and using the random forest regression model to predict the target area to obtain preliminary precipitation prediction results; calculating the residual between the preliminary precipitation prediction results and the downscaled baseline data, and correcting the preliminary precipitation prediction results based on the residual to obtain intermediate precipitation prediction results; calculating the first local mean of the downscaled baseline data and the second local mean of the intermediate precipitation prediction results, and scaling the intermediate precipitation prediction results based on the first local mean and the second local mean to obtain the final precipitation prediction results.
2. The method according to claim 1, characterized in that, The resolution of the original precipitation data is 0.01°, the resolution of the downscaled baseline data is 0.05°, and the resolution of the digital elevation model is 30 meters.
3. The method according to claim 2, characterized in that, The terrain factors include: elevation, slope, and terrain humidity index; the terrain factors are dynamically normalized to obtain standard terrain factors, including: determining local terrain using a sliding window, calculating the elevation range and slope standard deviation based on the terrain factors, and determining the local terrain complexity based on the elevation range and slope standard deviation in conjunction with the interquartile range; determining the weights of different local terrains based on the local terrain complexity, and calculating the standard terrain factors of the target area based on the weights of different local terrains.
4. The method according to claim 2, characterized in that, Using downscaled baseline data as the response variable and standard topographic factors as explanatory variables, a random forest regression model is constructed. This model is then used to predict precipitation in the target area, yielding preliminary precipitation forecast results. The process includes: training the random forest regression model based on downscaled baseline data of the effective precipitation area; determining the optimal parameters of the decision tree using performance saturation detection technology; constructing the random forest regression model; dividing the 30-meter resolution effective precipitation area into multiple data blocks and predicting precipitation data for each data block using the random forest regression model; and integrating the precipitation data from each data block to obtain preliminary precipitation forecast results for the 30-meter resolution effective precipitation area.
5. The method according to claim 1, characterized in that, The process of calculating the residuals between the preliminary precipitation forecast results and the downscaled baseline data, and correcting the preliminary precipitation forecast results based on the residuals to obtain intermediate precipitation forecast results includes: calculating the residuals using downscaled baseline data of the effective precipitation area and the corresponding preliminary precipitation forecast results; constructing an index for each residual, calculating the interpolation weight of each residual using nearest neighbor search, and fusing the residuals with the preliminary precipitation forecast results based on the interpolation weights to obtain intermediate precipitation forecast results.
6. The method according to claim 1, characterized in that, The process involves calculating a first local mean of the downscaled baseline data and a second local mean of the intermediate precipitation prediction results, and scaling the intermediate precipitation prediction results based on the first and second local means to obtain a final precipitation prediction result. This includes: acquiring a first actual distance corresponding to the resolution of the downscaled baseline data and a second actual distance corresponding to the resolution of the intermediate precipitation prediction results, and determining a sliding window size based on the first and second actual distances; calculating the first local mean of the downscaled baseline data and the second local mean of the intermediate precipitation prediction results for the same sliding window size; comparing the magnitudes of the first and second local means, scaling the intermediate precipitation prediction results according to the comparison result, and simultaneously using Gaussian smoothing to eliminate noise to obtain the final precipitation prediction result.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: based on the resolution of the final precipitation forecast result, overlaying administrative boundaries and latitude and longitude grids to generate a visualization result of the final precipitation forecast result.
8. A high-precision downscaling device for precipitation data based on terrain fusion and residual optimization, characterized in that, The device includes: a precipitation data downscaling module for acquiring raw precipitation data of the target area and aggregating the raw precipitation data to obtain downscaled baseline data; a topographic data processing module for acquiring a digital elevation model (DEM) of the target area and marking the DEM based on the downscaled baseline data to determine the effective precipitation area of the DEM; a topographic factor normalization module for extracting multiple topographic factors strongly correlated with precipitation distribution based on the effective precipitation area and dynamically normalizing the topographic factors to obtain standard topographic factors; and a model building and precipitation prediction module for using the downscaled baseline data as a response variable. The system employs a preliminary precipitation forecast by constructing a random forest regression model using standard topographic factors as explanatory variables, and then using this model to predict precipitation in the target area. A data correction module calculates the residual between the preliminary precipitation forecast and the downscaled baseline data, and corrects the preliminary precipitation forecast based on the residual to obtain an intermediate precipitation forecast. A local matching module calculates the first local mean of the downscaled baseline data and the second local mean of the intermediate precipitation forecast, and scales the intermediate precipitation forecast based on the first and second local means to obtain the final precipitation forecast.
9. An electronic device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method of any one of claims 1 to 7.