CN118096509A - Spatial interpolation method, spatial interpolation device, electronic equipment and storage medium - Google Patents

Spatial interpolation method, spatial interpolation device, electronic equipment and storage medium Download PDF

Info

Publication number
CN118096509A
CN118096509A CN202410082549.3A CN202410082549A CN118096509A CN 118096509 A CN118096509 A CN 118096509A CN 202410082549 A CN202410082549 A CN 202410082549A CN 118096509 A CN118096509 A CN 118096509A
Authority
CN
China
Prior art keywords
site
unknown
data
prediction
spatial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410082549.3A
Other languages
Chinese (zh)
Inventor
王军邦
朱躲萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Geographic Sciences and Natural Resources of CAS
Original Assignee
Institute of Geographic Sciences and Natural Resources of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Geographic Sciences and Natural Resources of CAS filed Critical Institute of Geographic Sciences and Natural Resources of CAS
Priority to CN202410082549.3A priority Critical patent/CN118096509A/en
Publication of CN118096509A publication Critical patent/CN118096509A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a spatial interpolation method, a spatial interpolation device, electronic equipment and a storage medium, and relates to the technical field of computer processing. The method comprises the following steps: acquiring a target observation area, wherein the target observation area comprises a plurality of known sites, a plurality of unknown sites and original climate data corresponding to each known site; crude prediction climate data of each unknown site are obtained according to the original climate data prediction; according to the spatial autocorrelation of each unknown site and the known site meeting the preset conditions, determining the prediction weight of each unknown site; according to the rough prediction climate data and the prediction weight corresponding to each unknown site, determining the prediction climate data of each unknown site; and carrying out climate data interpolation on the climate data to be predicted according to the climate data to be predicted, and obtaining an interpolation result. Therefore, the problems of low accuracy and large error of interpolation results of the sparse geographic position of the site in the traditional spatial interpolation mode can be solved.

Description

Spatial interpolation method, spatial interpolation device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer processing technologies, and in particular, to a spatial interpolation method, a spatial interpolation device, an electronic device, and a storage medium.
Background
At present, the methods for generating the climate observation spatially-networked products generally comprise interpolation generation, remote sensing products and analysis data.
For interpolation, mainly, a machine learning method and a traditional interpolation method are adopted, the machine learning method depends on surrounding variables to a great extent, for example, spatial autocorrelation is not considered, surrounding site correlation is not large, interpolation result accuracy is low, and uncertainty of interpolation in a site sparse area is large in the traditional interpolation method. Remote sensing products can suffer from significant errors due to environmental factors.
In addition, the remote sensing data is re-analyzed and fused based on deep learning, and the data of the climate observation products and the actual data obtained by the site observation data still have larger errors because the remote sensing data are mainly dependent on the original remote sensing products.
Disclosure of Invention
In view of the above, an object of the embodiments of the present application is to provide a spatial interpolation method, a spatial interpolation device, an electronic device, and a storage medium, which can solve the problems of low accuracy and large error of interpolation results for a sparse geographic position of a site in a conventional spatial interpolation method.
In order to achieve the technical purpose, the application adopts the following technical scheme:
in a first aspect, an embodiment of the present application provides a spatial interpolation method, where the method includes:
Acquiring a target observation area, wherein the target observation area comprises a plurality of known sites, a plurality of unknown sites and original climate data corresponding to each known site;
Predicting and obtaining rough prediction climate data of each unknown site according to the original climate data;
according to the spatial autocorrelation of each unknown site and the known site meeting the preset conditions, determining the prediction weight of each unknown site;
according to the rough prediction climate data and the prediction weights corresponding to each unknown site, determining prediction climate data of each unknown site;
And carrying out climate data interpolation on the climate data to be predicted according to the climate data to be predicted, and obtaining an interpolation result.
With reference to the first aspect, in some optional embodiments, determining the predicted climate data of each unknown site is implemented by a spatial interpolation model, wherein a training process of the spatial interpolation model is as follows:
Acquiring a target training set, wherein the target training set comprises a plurality of training samples, and each training sample comprises a known site and an unknown site of a target observation area and initial data corresponding to the known site;
Performing gating convolution operation on each training sample in the training set through a gating convolution layer in a preset initial model to predict a rough prediction result of the unknown site in each training sample;
Acquiring weight factors corresponding to each known site and each unknown site;
Determining a spatial weight corresponding to each unknown site through an attention module in the preset initial model according to the initial data and the weight factors corresponding to each known site, wherein the spatial weight represents the spatial autocorrelation between the current unknown site and each known site;
Taking the product of the spatial weights corresponding to the coarse prediction results and the coarse prediction results as the prediction result corresponding to each unknown site, and determining model loss through a loss function according to each prediction result and corresponding preset real data;
And updating parameters of the preset initial model according to the model loss until the model loss meets a preset model convergence condition, so as to obtain a spatial interpolation model.
With reference to the first aspect, in some optional embodiments, obtaining the target training set includes:
Acquiring weather samples of the target observation area at a plurality of different moments, wherein the weather samples comprise known stations, unknown stations and precipitation values corresponding to the known stations in the target observation area;
Masking the climatic sample to obtain masking data corresponding to the climatic sample;
generating a plurality of first feature maps with different scales corresponding to the mask data according to the mask data;
And carrying out weight pooling operation on each first characteristic diagram so as to carry out characteristic extraction on the precipitation value of the known site in each first characteristic diagram, obtaining a second characteristic diagram corresponding to each first characteristic diagram, taking the second characteristic diagram as the training sample, and taking the precipitation value after characteristic extraction as the initial data.
With reference to the first aspect, in some optional embodiments, the formula of the gating convolution operation is as follows:
In the method, in the process of the invention, Represents the j-th rough prediction result obtained after the gating convolution operation,/>Representing initial data in a convolution region of an ith convolution kernel of layer l-1; /(I)A weight representing an ith convolution kernel of the first layer; /(I)Representing a conventional convolution operation; b i l denotes the offset of the ith convolution kernel of the first layer; m represents the convolution region and f (·) represents the activation function.
With reference to the first aspect, in some optional embodiments, the initial data includes precipitation values characterizing precipitation per unit time of the known site, and the weight factors include site coordinates, elevation, and topography relief;
determining, by an attention module in the preset initial model, a spatial weight corresponding to each unknown site according to the initial data and the weight factors corresponding to each known site, including:
determining, by an attention module in the preset initial model, euclidean distances between the unknown site and each target known site:
Where distance i represents the Euclidean distance, Representing the coordinate difference of the current unknown site and the target known site,/>Representing the elevation difference of the current unknown site and the target known site,/>Representing the difference between the topography relief of the current unknown site and the target known site,/>Representing the difference between an initial predicted value corresponding to a current unknown site and a precipitation value corresponding to a target known site, wherein the target known site represents a known site which is within a preset distance range from the current unknown site;
normalizing the Euclidean distance to determine the predictive weight:
weighti=softmin(distancei,{distance0,distance1,…,distancen})
Where weight i represents the prediction weight and { distance 0,distance1,…,distancen } represents the set of euclidean distances.
With reference to the first aspect, in some optional embodiments, the loss function is as follows:
Where n represents the number of samples, h (x k) represents the predicted result of the kth training sample, y k represents the preset real data corresponding to the kth training sample, and I i,j represents the predicted result corresponding to the unknown site located at (I, j).
In a second aspect, an embodiment of the present application further provides a spatial interpolation apparatus, including:
the first acquisition unit is used for acquiring a target observation area, wherein the target observation area comprises a plurality of known stations, a plurality of unknown stations and original climate data corresponding to each known station;
The prediction unit is used for predicting and obtaining rough prediction climate data of each unknown site according to the original climate data;
The first determining unit is used for determining the prediction weight of each unknown station according to the spatial autocorrelation of each unknown station and the known station meeting the preset condition;
the second determining unit is used for determining the predicted climate data of each unknown site according to the rough predicted climate data and the predicted weight corresponding to each unknown site;
and the interpolation unit is used for interpolating the climate data to be predicted according to the climate data to be predicted to obtain an interpolation result.
With reference to the second aspect, in some optional embodiments, the apparatus further includes:
the second acquisition unit is used for acquiring a target training set, wherein the target training set comprises a plurality of training samples, and each training sample comprises a known site and an unknown site of a target observation area and initial data corresponding to the known site;
The convolution unit is used for carrying out gating convolution operation on each training sample in the training set through a gating convolution layer in a preset initial model so as to predict a rough prediction result of the unknown site in each training sample;
the third acquisition unit is used for acquiring the weight factors corresponding to each known site and each unknown site;
The third determining unit is used for determining a spatial weight corresponding to each unknown site through an attention module in the preset initial model according to the initial data and the weight factors corresponding to each known site, and the spatial weight represents the spatial autocorrelation between the current unknown site and each known site;
a fourth determining unit, configured to take products of the respective coarse prediction results and the spatial weights corresponding to the respective coarse prediction results as prediction results corresponding to each unknown site, and determine model loss through a loss function according to each prediction result and corresponding preset real data;
and the training unit is used for updating parameters of the preset initial model according to the model loss until the model loss meets a preset model convergence condition to obtain a spatial interpolation model.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes a processor and a memory coupled to each other, where the memory stores a computer program, and when the computer program is executed by the processor, causes the electronic device to perform the method described above.
In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to perform the above-described method.
The invention adopting the technical scheme has the following advantages:
according to the technical scheme provided by the application, a target observation area is firstly obtained, wherein the target observation area comprises a plurality of known stations, a plurality of unknown stations and original climate data corresponding to each known station, then coarse prediction climate data of each unknown station are obtained according to prediction of the original climate data, the prediction weight of each unknown station is determined according to spatial autocorrelation of each unknown station and all known stations, then the prediction climate data of each unknown station is determined according to the coarse prediction climate data and the prediction weight corresponding to each unknown station, and finally climate data interpolation is carried out on the climate data to be predicted according to the prediction climate data, so that an interpolation result is obtained. Therefore, the problems of low accuracy and large error of interpolation results of the sparse geographic position of the site in the traditional spatial interpolation mode can be improved.
Drawings
The application may be further illustrated by means of non-limiting examples given in the accompanying drawings. It is to be understood that the following drawings illustrate only certain embodiments of the application and are therefore not to be considered limiting of its scope, for the person of ordinary skill in the art may admit to other equally relevant drawings without inventive effort.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present application.
Fig. 2 is a schematic flow chart of a spatial interpolation method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a training process of a spatial interpolation model according to an embodiment of the present application.
Fig. 4 is an exemplary diagram of weight pooling provided in an embodiment of the present application.
Fig. 5 is a process example diagram of a gated convolution operation according to an embodiment of the present disclosure.
Fig. 6 is a schematic diagram of a determination process of spatial weights according to an embodiment of the present application.
Fig. 7 is a schematic flow chart of spatial interpolation of training samples according to an embodiment of the present application.
Fig. 8 is a block diagram of a spatial interpolation apparatus according to an embodiment of the present application.
Icon: 100-an electronic device; a 101-processor; 102-memory; 300-spatial interpolation means; 310-a first acquisition unit; 320-a prediction unit; 330-a first determination unit; 340-a second determination unit; 350-interpolation unit.
Detailed Description
The present application will be described in detail below with reference to the drawings and the specific embodiments, wherein like or similar parts are designated by the same reference numerals throughout the drawings or the description, and implementations not shown or described in the drawings are in a form well known to those of ordinary skill in the art. In the description of the present application, the terms "first," "second," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, an electronic device 100 according to an embodiment of the application may include a processor 101 and a memory 102. The memory 102 stores a computer program which, when executed by the processor 101, enables the electronic device 100 to perform the respective steps in the spatial interpolation method described below.
In this embodiment, the electronic device 100 may be a personal computer, a notebook computer, a cloud server, or the like, and is configured to obtain a target observation area, predict and obtain rough predicted climate data of each unknown site according to original climate data carried in the target observation area, determine a prediction weight of each unknown site according to spatial autocorrelation of each unknown site and all known sites, determine predicted climate data of each unknown site according to the rough predicted climate data and the prediction weight corresponding to each unknown site, and finally interpolate climate data to be predicted according to the predicted climate data to obtain an interpolation result.
Referring to fig. 2, the present application further provides a spatial interpolation method, which can be applied to the electronic device 100, and the electronic device 100 executes or implements each step in the method. The spatial interpolation method may include the steps of:
step 110, acquiring a target observation area, wherein the target observation area comprises a plurality of known sites, a plurality of unknown sites and original climate data corresponding to each known site;
Step 120, predicting and obtaining rough prediction climate data of each unknown site according to the original climate data;
Step 130, determining the prediction weight of each unknown site according to the spatial autocorrelation of each unknown site and the known site meeting the preset condition;
step 140, determining the predicted climate data of each unknown site according to the rough predicted climate data and the predicted weight corresponding to each unknown site;
And step 150, carrying out climate data interpolation on the climate data to be predicted according to the climate data to be predicted, and obtaining an interpolation result.
In the above embodiment, the target observation area is first obtained, where the target observation area includes a plurality of known sites, a plurality of unknown sites, and original climate data corresponding to each known site, then rough prediction climate data of each unknown site is obtained by prediction according to the original climate data, and a prediction weight of each unknown site is determined according to spatial autocorrelation of each unknown site and all known sites, then prediction climate data of each unknown site is determined according to the rough prediction climate data and the prediction weight corresponding to each unknown site, and finally climate data interpolation is performed on the climate data to be predicted according to the prediction climate data, so as to obtain an interpolation result. Therefore, the problems of low accuracy and large error of interpolation results of the sparse geographic position of the site in the traditional spatial interpolation mode can be improved.
The steps of the spatial interpolation method will be described in detail below, as follows:
In step 110, in order to solve the problem of inaccurate climate observation in sparse areas of sites, the target observation area may be a geographic area with fewer sites for arbitrary climate observation, and in this embodiment, a Qinghai-Tibet plateau area is taken as an example.
It can be understood that the climate observation site is taken as an interpolation object in the technical scheme, and the climate data is supplemented and perfected for the area with sparse site distribution. Therefore, in order to facilitate implementation of the technical scheme, the target observation area is rasterized, wherein a climate observation site is arranged, and a grid of climate data of the position of the climate observation site can be directly observed through the climate observation site, and each known site is used as a known site and carries original climate data obtained by observing the position of the site; the grid of climate observation sites is not set as an unknown site.
In this embodiment, the target observation area may be obtained by acquiring data based on a preset rule in real time, taking the Qinghai-Tibet plateau area as an example, the position distribution of the known site and the unknown site of the area may be obtained at 23:59 of the last day of each month, and month climate data (the climate data may be temperature, humidity, precipitation value, etc.) observed by each known site in the month of the area is taken as an original climate number; or the target observation area may be to store the above-mentioned month climate data in the memory 102 of the electronic device 100 as history data, and call data satisfying the user's needs, such as the location distribution of known and unknown sites of the Qinghai-Tibet plateau area in the last month, and the month average temperature observed by each known site, from the history data based on the user's operation instruction. The manner of acquiring the target observation area is not particularly limited here.
In step 120, data prediction is performed on each unknown site according to the original climate data of each known site through a gated convolution operation, so as to obtain rough prediction climate data corresponding to each unknown site.
Specifically, in the operation process of the gating convolution, reference is made to the following description of the gate convolution operation in the training of the spatial interpolation model, which is not described herein.
In step 130, the spatial autocorrelation (i.e. coordinate difference, elevation difference, topography relief difference, data difference, etc.) between each unknown site and the known sites satisfying the preset condition (i.e. the known sites whose distance from the unknown site is within the preset range, in practical application, generally all the known sites) is used as the prediction weight for correcting the rough prediction climate data.
In this way, the data prediction of the unknown site can be made more accurate. Specifically, the determination method of the prediction weight refers to the following description of the spatial weight in the training of the spatial interpolation model, which is not described herein in detail.
In step 140, the product of the coarse predicted climate data and the prediction weights is used as the predicted climate data for each unknown site.
In step 150, the predicted climate data obtained by predicting each unknown site is used as an interpolation result of the unknown site, and the climate data to be predicted comprising the known site and the unknown site is interpolated to obtain an interpolation result.
Referring to fig. 3, in the present embodiment, steps 120 to 140 are implemented by a spatial interpolation model, wherein the training process of the spatial interpolation model is as follows:
step 210, obtaining a target training set, wherein the target training set comprises a plurality of training samples, and each training sample comprises a known site and an unknown site of a target observation area and initial data corresponding to the known site;
Step 220, performing a gated convolution operation on each training sample in the training set through a gated convolution layer in a preset initial model to predict a coarse prediction result of the unknown site in each training sample;
Step 230, obtaining weight factors corresponding to each known site and each unknown site;
Step 240, determining, according to the initial data and the weight factors corresponding to each known site, a spatial weight corresponding to each unknown site through an attention module in the preset initial model, where the spatial weight characterizes spatial autocorrelation between a current unknown site and each known site;
Step 250, taking the product of the spatial weights corresponding to the coarse prediction results and the coarse prediction results as the prediction result corresponding to each unknown site, and determining model loss through a loss function according to each prediction result and corresponding preset real data;
And 260, updating parameters of the preset initial model according to the model loss until the model loss meets a preset model convergence condition, and obtaining a spatial interpolation model.
In step 210, in order to facilitate implementation of the present technical solution, in this embodiment, a target observation area (in this embodiment, the problem of inaccurate climate observation in a sparse area of a site is solved, so the target observation area may be an area with fewer arbitrary observation sites, in this embodiment, a Qinghai-Tibet plateau area is taken as an example) is used as a data source for daily precipitation data in 1980-2020, and in order to facilitate data processing and optimize the presentation effect of precipitation data, the daily precipitation data of the target observation area is combined into monthly precipitation data. In practical application, in order to facilitate the subsequent calculation of the spatial autocorrelation among different sites, the monthly precipitation data may further include elevation, topography relief and longitude and latitude data of each site.
In this embodiment, obtaining the target training set may include:
Acquiring weather samples of the target observation area at a plurality of different moments, wherein the weather samples comprise known stations, unknown stations and precipitation values corresponding to the known stations in the target observation area;
Masking the climatic sample to obtain masking data corresponding to the climatic sample;
generating a plurality of first feature maps with different scales corresponding to the mask data according to the mask data;
And carrying out weight pooling operation on each first characteristic diagram so as to carry out characteristic extraction on the precipitation value of the known site in each first characteristic diagram, obtaining a second characteristic diagram corresponding to each first characteristic diagram, taking the second characteristic diagram as the training sample, and taking the precipitation value after characteristic extraction as the initial data.
It can be understood that, in order to facilitate data processing, the foregoing monthly rainfall data needs to be preprocessed in practical application, and specifically, because the present technical solution is to perform feature extraction and interpolation by taking a site as an object, in order to reduce interference of non-effective data (i.e. rainfall values carried in unknown sites, usually noise) in a feature extraction process, firstly, gridding an initial image according to longitude and latitude of each site in a target observation area (size is 1km×1 km) and generating mask data (i.e. a grid with a site is effective data, a mask data is assigned as 1, a grid without a site is ineffective data, and a mask data is assigned as 0), so as to identify effectiveness of the grid data.
In this embodiment, according to the mask data obtained after masking, a plurality of first feature maps with different scales corresponding to the mask data of the target observation area in the month between 1980 and 2020 are generated in the month unit. Therefore, the spatial variation trend of the variable to be interpolated in a larger area range can be obtained more easily, and feature disassembly from trend to spatial detail can be completed.
In this embodiment, all grids in the first feature map are regarded as one site, and all sites are divided into known sites and unknown sites according to the validity of data in the grids, that is, a grid with the mask data of 1 is defined as a known site, and a grid with the mask data of 0 is defined as an unknown site.
In this embodiment, a weight pooling operation is performed on a known site, so that feature extraction is performed on first feature graphs with different scales, and a second feature graph corresponding to each first feature graph is obtained. Therefore, the problem of direct recovery of high-resolution data, namely climate interpolation prediction, is converted into the problem of gradual recovery of high-resolution data of low-resolution data by taking the multi-scale feature map (namely the second feature map) as a subsequent convolution input mode, so that model training difficulty is reduced, and model stability is improved.
Specifically, referring to fig. 4, weight pooling denotes weight pooling, image Representation denotes an image representation representing a first feature map, mask Representation denotes a mask representation representing mask data corresponding to the first feature map, 1 denotes an effective value of a current grid being a known site, and 0 denotes an ineffective value of the current grid being an unknown site in Mask Representation. In the technical scheme, 2×2 grid-sized kernel (pooling kernel) and 2-grid step pooling are performed on precipitation values in the first feature map. In the pooling process, each time feature extraction is carried out through a kernel, a grid in the kernel is an invalid value, and the pooling weight corresponding to the kernel is 0; the grids in the kernel contain effective values, and the pooling weight corresponding to the kernel is the inverse of the number of the effective values.
For example, taking the first feature extraction in fig. 4 as an example, kernel covers four grids (0, 1, 0) in the feature extraction process, where Mask Representation is (0, 1, 0), that is, in the first feature extraction process, the first grid is an invalid value, the second and third grids are valid values, the fourth grid is an invalid value, the sum of valid values of kernel is 1, and the number of valid values in Mask Representation is 1+1=2, and Weight pooling (0, 1, 0)/(0, 1, 0) =1/2=0.5. Similarly, in the second feature extraction process, kernel covers four grids (2, 0), the sum of the effective values is 2, corresponding Mask Representation is (1, 0), namely the number of effective values is 1, weight pooling (2, 0)/(1, 0) =2/1=2. And similarly, performing feature extraction on the precipitation values in the first feature map by taking four grids as a kernel and taking the stride as 2 until all the precipitation values in the first feature map are covered, namely finishing the weight pooling operation, and obtaining a second feature map. And a plurality of second feature maps with different scales corresponding to the mask data of each month are taken as a training sample together.
In step 220, the formula of the gating convolution operation is as follows:
In the method, in the process of the invention, Represents the j-th rough prediction result obtained after the gating convolution operation,/>Representing initial data in a convolution region of an ith convolution kernel of layer l-1; /(I)A weight representing an ith convolution kernel of the first layer; /(I)Representing a conventional convolution operation; b i l denotes the offset of the ith convolution kernel of the first layer; m represents the convolution region and f (·) represents the activation function.
It can be understood that the conventional convolution mainly extracts advanced semantic features from data, the convolution is that a partial region of input data and a convolution kernel perform matrix operation, and a convolution output value is subjected to nonlinear transformation through an activation function after a corresponding offset is added. In the convolutional neural network, a filter performs convolutional calculation on local input data, and after each calculation of the local data in one data window, the data window continuously translates and slides until all the data are calculated, and the conventional convolutional calculation process is shown as a formula (3).
In this embodiment, the grid without sites (i.e., unknown sites) in the second feature map (i.e., training sample) with different scales is data-filled by using gated convolution. Coding efficiency is further improved by filling the missing regions of compact potential features into low-level features (with higher resolution and richer detail). Where the gated convolution is a modified version of the conventional convolution that considers all peripheral features, but not all peripheral features are valid for interpolation of climate-type data, the effect of invalid values on the convolution needs to be eliminated. The adoption of the gating convolution enables a network model to learn a dynamic characteristic selection mechanism of each channel and each space position to endow precipitation values of unknown site areas, wherein the calculation process of the gating convolution is shown in a formula (1) and a formula (2). And (2) carrying out normalization processing on the conventional convolution operation through a sigmoid activation function to serve as the weight of the gating convolution operation, multiplying the weight by the conventional convolution result to update the conventional convolution result, and obtaining the gating convolution result corresponding to each second feature map, wherein the data obtained after the gating convolution at each unknown site serves as a coarse prediction result.
Illustratively, referring to fig. 5, as shown in the first horizontal row in the middle part of fig. 5, a second feature map of 3 channels (mxn×3, M, N representing the length and width of the second feature map, and 3 representing the number of channels) is subjected to conventional convolution, and an offset b1 is added, and then a conventional convolution result is obtained by activating a function ReLU; as shown in a second horizontal row in the middle part of fig. 5, after the second feature map is convolved, adding a bias b2, and normalizing the convolution result after adding the bias b2 through a sigmoid activation function to obtain the weight of the gated convolution operation; the normal convolution result of the first transversal row is then multiplied by the convolution weights of the second transversal row to obtain a single-channel gated convolution result (mxn x 1).
In step 230, the weight factors may include site coordinates, elevation, and topography relief.
In step 240, determining, by the attention module in the preset initial model, a spatial weight corresponding to each unknown site according to the initial data and the weight factors corresponding to each known site may include:
determining, by an attention module in the preset initial model, euclidean distances between the unknown site and each target known site:
Where distance i represents the Euclidean distance, Representing the coordinate difference of the current unknown site and the target known site,/>Representing the elevation difference of the current unknown site and the target known site,/>Representing the difference between the topography relief of the current unknown site and the target known site,/>Representing the difference between an initial predicted value corresponding to a current unknown site and a precipitation value corresponding to a target known site, wherein the target known site represents a known site which is within a preset distance range from the current unknown site;
normalizing the Euclidean distance to determine the predictive weight:
weighti=softmin(distancei,{distance0,distance1,…,distancen}) (5)
Where weight i represents the prediction weight and { distance 0,distance1,…,distancen } represents the set of euclidean distances.
In this embodiment, the attention module determines the spatial weight, the spatial weight considers the position and the terrain information (i.e. elevation, terrain relief, etc.) between the unknown site and the known site, and introduces the difference between the precipitation values of the two as one of the variables, so that the predicted value of the unknown site focuses on the spatial autocorrelation of the unknown site and the known site, focuses on the characteristic association between the precipitation values, so that in the process that the unknown site is gradually filled, the generation of each stage of data has a more reliable reference, and the accuracy of the model prediction for interpolation of the precipitation values of the unknown site is improved.
Specifically, referring to fig. 6, in fig. 6, station features represents site characteristics, precipitation features represents precipitation value characteristics, flat represents flattening a grid, for example, transforming a grid of 2×2 size to 1×4 size, facilitating similarity measurement, reshape represents grid restoration, for example, restoring a grid of 1×4 size to 2×2 size, pdist represents euclidean distance calculation, attention map represents Attention force diagram composed of weight factors and predictive weights, f (x), g (x), h (x) represent different linear functions, respectively, and can be understood as a full-connection layer in an Attention module, where x represents an input composed of weight factors. In practical application, the weight factors are linearly transformed by f (x) and g (x), euclidean distance is calculated, precipitation characteristics are obtained by linearly varying precipitation values by h (x), and the Euclidean distance is multiplied by the precipitation characteristics to obtain the attention diagram.
In step 250, the preset real data may be a real precipitation value obtained by performing on-site rainfall observation on a geographic location corresponding to an unknown site, and the real precipitation value and a prediction result corresponding to the real precipitation value are brought into a preset loss function of a model, and a final model loss is determined by the preset loss function, where the model loss characterizes an error between the prediction result and the real precipitation value.
Wherein the loss function is as follows:
Where n represents the number of samples, h (x k) represents the predicted result of the kth training sample, y k represents the preset real data corresponding to the kth training sample, and I i,j represents the predicted result corresponding to the unknown site located at (I, j).
In step 260, after determining the model loss according to the loss function in step 250, updating parameters of the preset initial model according to the model loss until the model loss meets the preset model convergence condition, and completing model training to obtain the spatial interpolation model.
In this embodiment, the preset model convergence condition may be that the model loss is stable and is the minimum value.
In summary, referring to fig. 7, masking (Stations masking) a target observation area including a site and initial data in a training sample to obtain masking data (Stations value), weighting pooling (Weight pooling) the masking data to obtain multiple second feature maps with different scales, performing a gating convolution operation (GateConv) on the second feature maps to obtain a gating convolution result, determining a spatial weight of each unknown site according to a spatial autocorrelation (weight factor) between the unknown site and a known site, performing feature fusion on the gating convolution result and an Attention map (Attention) formed by the weight factor and the spatial weight to obtain a prediction result corresponding to each second feature map, and finally performing feature fusion on the prediction results corresponding to the multiple second feature maps through conventional convolution (Conv) to obtain an interpolation map of the target observation area. The prediction results corresponding to the second feature graphs with different scales are subjected to feature fusion through convolution to obtain a final interpolation result, which is a technical means known to a person skilled in the art of convolutional neural networks.
Referring to fig. 8, the present application further provides a spatial interpolation device 300, where the spatial interpolation device 300 includes at least one software function module that may be stored in the memory 102 in the form of software or Firmware (Firmware) or cured in an Operating System (OS) of the electronic device 100. The processor 101 is configured to execute executable modules stored in the memory 102, such as software functional modules and computer programs included in the spatial interpolation device 300.
The spatial interpolation apparatus 300 includes a first acquisition unit 310, a prediction unit 320, a first determination unit 330, a second determination unit 340, and an interpolation unit 350, each of which has the following functions:
A first obtaining unit 310, configured to obtain a target observation area, where the target observation area includes a plurality of known sites, a plurality of unknown sites, and original climate data corresponding to each known site;
a prediction unit 320, configured to predict and obtain rough predicted climate data of each unknown site according to the original climate data;
A first determining unit 330, configured to determine a prediction weight of each unknown station according to spatial autocorrelation of each unknown station and a known station that satisfies a preset condition;
A second determining unit 340, configured to determine predicted climate data of each unknown site according to the rough predicted climate data and the predicted weight corresponding to each unknown site;
And the interpolation unit 350 is configured to interpolate the climate data to be predicted according to the predicted climate data, so as to obtain an interpolation result.
Optionally, the spatial interpolation device 300 further includes:
the second acquisition unit is used for acquiring a target training set, wherein the target training set comprises a plurality of training samples, and each training sample comprises a known site and an unknown site of a target observation area and initial data corresponding to the known site;
The convolution unit is used for carrying out gating convolution operation on each training sample in the training set through a gating convolution layer in a preset initial model so as to predict a rough prediction result of the unknown site in each training sample;
the third acquisition unit is used for acquiring the weight factors corresponding to each known site and each unknown site;
The third determining unit is used for determining a spatial weight corresponding to each unknown site through an attention module in the preset initial model according to the initial data and the weight factors corresponding to each known site, and the spatial weight represents the spatial autocorrelation between the current unknown site and each known site;
a fourth determining unit, configured to take products of the respective coarse prediction results and the spatial weights corresponding to the respective coarse prediction results as prediction results corresponding to each unknown site, and determine model loss through a loss function according to each prediction result and corresponding preset real data;
and the training unit is used for updating parameters of the preset initial model according to the model loss until the model loss meets a preset model convergence condition to obtain a spatial interpolation model.
Optionally, the second obtaining unit is further configured to:
Acquiring weather samples of the target observation area at a plurality of different moments, wherein the weather samples comprise known stations, unknown stations and precipitation values corresponding to the known stations in the target observation area;
Masking the climatic sample to obtain masking data corresponding to the climatic sample;
generating a plurality of first feature maps with different scales corresponding to the mask data according to the mask data;
And carrying out weight pooling operation on each first characteristic diagram so as to carry out characteristic extraction on the precipitation value of the known site in each first characteristic diagram, obtaining a second characteristic diagram corresponding to each first characteristic diagram, taking the second characteristic diagram as the training sample, and taking the precipitation value after characteristic extraction as the initial data.
Optionally, the formula of the gating convolution operation is as follows:
In the method, in the process of the invention, Represents the j-th rough prediction result obtained after the gating convolution operation,/>Representing initial data in a convolution region of an ith convolution kernel of layer l-1; /(I)A weight representing an ith convolution kernel of the first layer; /(I)Representing a conventional convolution operation; b i l denotes the offset of the ith convolution kernel of the first layer; m represents the convolution region and f (·) represents the activation function.
Optionally, the third determining unit is further configured to:
determining, by an attention module in the preset initial model, euclidean distances between the unknown site and each target known site:
Where distance i represents the Euclidean distance, Representing the coordinate difference of the current unknown site and the target known site,/>Representing the elevation difference of the current unknown site and the target known site,/>Representing the difference between the topography relief of the current unknown site and the target known site,/>Representing the difference between an initial predicted value corresponding to a current unknown site and a precipitation value corresponding to a target known site, wherein the target known site represents a known site which is within a preset distance range from the current unknown site;
normalizing the Euclidean distance to determine the predictive weight:
weighti=softmin(distancei,{distance0,distance1,…,distancen})
Where weight i represents the prediction weight and { distance 0,distance1,…,distancen } represents the set of euclidean distances.
Optionally, the loss function is as follows:
Where n represents the number of samples, h (x k) represents the predicted result of the kth training sample, y k represents the preset real data corresponding to the kth training sample, and I i,j represents the predicted result corresponding to the unknown site located at (I, j).
In this embodiment, the processor 101 may be an integrated circuit chip with signal processing capability. The processor 101 may be a general-purpose processor. For example, the processor 101 may be a central Processing unit (Central Processing Unit, CPU), digital signal processor (DIGITAL SIGNAL Processing, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic, discrete hardware components, or may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the application.
The memory 102 may be, but is not limited to, random access memory, read only memory, programmable read only memory, erasable programmable read only memory, electrically erasable programmable read only memory, and the like. In this embodiment, the memory 102 may be configured to store a target observation area, rough predicted climate data, preset conditions, predicted weights, predicted climate data, interpolation results, a target training set, rough predicted results, weighting factors, spatial weights, predicted results, model losses, preset model convergence conditions, spatial interpolation models, and the like. Of course, the memory 102 may also be used to store a program that the processor 101 executes after receiving the execution instruction.
It is understood that the electronic device 100 shown in fig. 1 is only a schematic structural diagram, and that the electronic device 100 may also include more components than those shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
It should be noted that, for convenience and brevity of description, specific working processes of the electronic device 100 described above may refer to corresponding processes of each step in the foregoing method, and will not be described in detail herein.
The embodiment of the application also provides a computer readable storage medium. The computer-readable storage medium has stored therein a computer program which, when run on a computer, causes the computer to perform the spatial interpolation method as described in the above embodiments.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that the present application may be implemented in hardware, or by means of software plus a necessary general hardware platform, and based on this understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disc, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective implementation scenario of the present application.
In summary, the embodiments of the present application provide a spatial interpolation method, apparatus, electronic device, and storage medium. In the technical scheme, a target observation area is firstly obtained, wherein the target observation area comprises a plurality of known stations, a plurality of unknown stations and original climate data corresponding to each known station, then coarse prediction climate data of each unknown station is obtained according to prediction of the original climate data, the prediction weight of each unknown station is determined according to spatial autocorrelation of each unknown station and all known stations, then the prediction climate data of each unknown station is determined according to the coarse prediction climate data and the prediction weight corresponding to each unknown station, and finally climate data interpolation is carried out on the climate data to be predicted according to the prediction climate data, so that an interpolation result is obtained. Therefore, the problems of low accuracy and large error of interpolation results of the sparse geographic position of the site in the traditional spatial interpolation mode can be improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus, system and method may be implemented in other manners as well. The above-described apparatus, system, and method embodiments are merely illustrative, for example, flow charts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method of spatial interpolation, the method comprising:
Acquiring a target observation area, wherein the target observation area comprises a plurality of known sites, a plurality of unknown sites and original climate data corresponding to each known site;
Predicting and obtaining rough prediction climate data of each unknown site according to the original climate data;
according to the spatial autocorrelation of each unknown site and the known site meeting the preset conditions, determining the prediction weight of each unknown site;
according to the rough prediction climate data and the prediction weights corresponding to each unknown site, determining prediction climate data of each unknown site;
And carrying out climate data interpolation on the climate data to be predicted according to the climate data to be predicted, and obtaining an interpolation result.
2. The method of claim 1, wherein determining the predicted climate data for each unknown site is accomplished by a spatial interpolation model, wherein the training process for the spatial interpolation model is as follows:
Acquiring a target training set, wherein the target training set comprises a plurality of training samples, and each training sample comprises a known site and an unknown site of a target observation area and initial data corresponding to the known site;
Performing gating convolution operation on each training sample in the training set through a gating convolution layer in a preset initial model to predict a rough prediction result of the unknown site in each training sample;
Acquiring weight factors corresponding to each known site and each unknown site;
Determining a spatial weight corresponding to each unknown site through an attention module in the preset initial model according to the initial data and the weight factors corresponding to each known site, wherein the spatial weight represents the spatial autocorrelation between the current unknown site and each known site;
Taking the product of the spatial weights corresponding to the coarse prediction results and the coarse prediction results as the prediction result corresponding to each unknown site, and determining model loss through a loss function according to each prediction result and corresponding preset real data;
And updating parameters of the preset initial model according to the model loss until the model loss meets a preset model convergence condition, so as to obtain a spatial interpolation model.
3. The method of claim 2, wherein obtaining the target training set comprises:
Acquiring weather samples of the target observation area at a plurality of different moments, wherein the weather samples comprise known stations, unknown stations and precipitation values corresponding to the known stations in the target observation area;
Masking the climatic sample to obtain masking data corresponding to the climatic sample;
generating a plurality of first feature maps with different scales corresponding to the mask data according to the mask data;
And carrying out weight pooling operation on each first characteristic diagram so as to carry out characteristic extraction on the precipitation value of the known site in each first characteristic diagram, obtaining a second characteristic diagram corresponding to each first characteristic diagram, taking the second characteristic diagram as the training sample, and taking the precipitation value after characteristic extraction as the initial data.
4. The method of claim 2, wherein the gating convolution operation is formulated as follows:
In the method, in the process of the invention, Represents the j-th rough prediction result obtained after the gating convolution operation,/>Representing initial data in a convolution region of an ith convolution kernel of layer l-1; /(I)A weight representing an ith convolution kernel of the first layer; /(I)Representing a conventional convolution operation; b i l denotes the offset of the ith convolution kernel of the first layer; m represents the convolution region and f (·) represents the activation function.
5. The method of claim 2, wherein the initial data includes precipitation values characterizing precipitation per unit time for the known site, the weight factors including site coordinates, elevation, and topography relief;
determining, by an attention module in the preset initial model, a spatial weight corresponding to each unknown site according to the initial data and the weight factors corresponding to each known site, including:
determining, by an attention module in the preset initial model, euclidean distances between the unknown site and each target known site:
Where distance i represents the Euclidean distance, Representing the coordinate difference of the current unknown site and the target known site,/>Representing the elevation difference of the current unknown site and the target known site,/>Representing the difference between the topography relief of the current unknown site and the target known site,/>Representing the difference between an initial predicted value corresponding to a current unknown site and a precipitation value corresponding to a target known site, wherein the target known site represents a known site which is within a preset distance range from the current unknown site;
normalizing the Euclidean distance to determine the predictive weight:
weighti=softmin(distancei,{distance0,distance1,…,distancen})
Where weight i represents the prediction weight and { distance 0,distance1,…,distancen } represents the set of euclidean distances.
6. The method of claim 2, wherein the loss function is as follows:
Where n represents the number of samples, h (x k) represents the predicted result of the kth training sample, y k represents the preset real data corresponding to the kth training sample, and I i,j represents the predicted result corresponding to the unknown site located at (I, j).
7. A spatial interpolation apparatus, the apparatus comprising:
the first acquisition unit is used for acquiring a target observation area, wherein the target observation area comprises a plurality of known stations, a plurality of unknown stations and original climate data corresponding to each known station;
The prediction unit is used for predicting and obtaining rough prediction climate data of each unknown site according to the original climate data;
The first determining unit is used for determining the prediction weight of each unknown station according to the spatial autocorrelation of each unknown station and the known station meeting the preset condition;
the second determining unit is used for determining the predicted climate data of each unknown site according to the rough predicted climate data and the predicted weight corresponding to each unknown site;
and the interpolation unit is used for interpolating the climate data to be predicted according to the climate data to be predicted to obtain an interpolation result.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the second acquisition unit is used for acquiring a target training set, wherein the target training set comprises a plurality of training samples, and each training sample comprises a known site and an unknown site of a target observation area and initial data corresponding to the known site;
The convolution unit is used for carrying out gating convolution operation on each training sample in the training set through a gating convolution layer in a preset initial model so as to predict a rough prediction result of the unknown site in each training sample;
the third acquisition unit is used for acquiring the weight factors corresponding to each known site and each unknown site;
The third determining unit is used for determining a spatial weight corresponding to each unknown site through an attention module in the preset initial model according to the initial data and the weight factors corresponding to each known site, and the spatial weight represents the spatial autocorrelation between the current unknown site and each known site;
a fourth determining unit, configured to take products of the respective coarse prediction results and the spatial weights corresponding to the respective coarse prediction results as prediction results corresponding to each unknown site, and determine model loss through a loss function according to each prediction result and corresponding preset real data;
and the training unit is used for updating parameters of the preset initial model according to the model loss until the model loss meets a preset model convergence condition to obtain a spatial interpolation model.
9. An electronic device comprising a processor and a memory coupled to each other, the memory storing a computer program that, when executed by the processor, causes the electronic device to perform the method of any of claims 1-6.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when run on a computer, causes the computer to perform the method according to any of claims 1-6.
CN202410082549.3A 2024-01-19 2024-01-19 Spatial interpolation method, spatial interpolation device, electronic equipment and storage medium Pending CN118096509A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410082549.3A CN118096509A (en) 2024-01-19 2024-01-19 Spatial interpolation method, spatial interpolation device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410082549.3A CN118096509A (en) 2024-01-19 2024-01-19 Spatial interpolation method, spatial interpolation device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118096509A true CN118096509A (en) 2024-05-28

Family

ID=91141341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410082549.3A Pending CN118096509A (en) 2024-01-19 2024-01-19 Spatial interpolation method, spatial interpolation device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118096509A (en)

Similar Documents

Publication Publication Date Title
US11333796B2 (en) Spatial autocorrelation machine learning-based downscaling method and system of satellite precipitation data
CN110986747B (en) Landslide displacement combined prediction method and system
CN112446419A (en) Time-space neural network radar echo extrapolation forecasting method based on attention mechanism
CN114254561A (en) Waterlogging prediction method, waterlogging prediction system and storage medium
US11836605B2 (en) Meteorological big data fusion method based on deep learning
Goncalves et al. A comparison between three short-term shoreline prediction models
CN112668238B (en) Rainfall processing method, rainfall processing device, rainfall processing equipment and storage medium
Chen et al. Probabilistic forecasting of drought: a hidden Markov model aggregated with the RCP 8.5 precipitation projection
Şen et al. Regional wind energy evaluation in some parts of Turkey
US20100036793A1 (en) Method and System for Geospatial Forecasting of Events Incorporating Data Error and Uncertainty
CN113779113B (en) Flood dynamic estimation method and system based on rainfall flood space-time process similarity excavation
CN116229419B (en) Pedestrian detection method and device
CN116796649A (en) SPEI coarse resolution data space downscaling method and device based on machine learning
CN111505738A (en) Method and equipment for predicting meteorological factors in numerical weather forecast
CN116611725A (en) Land type identification method and device based on green ecological index
CN116957143A (en) Village air rate prediction method, village air rate prediction device, electronic equipment and readable storage medium
CN118096509A (en) Spatial interpolation method, spatial interpolation device, electronic equipment and storage medium
CN108712317B (en) Urban crowd space-time dynamic sensing method and system based on mobile social network
KR102401823B1 (en) System and method for computing thermal environment application index by disaster type, and weather factor of intense heat and freeze
CN116091939A (en) Forest on-ground biomass downscaling method based on multiscale geographic weighted regression
CN115239027A (en) Method and device for air quality lattice ensemble prediction
CN115689106A (en) Method, device and equipment for quantitatively identifying regional space structure of complex network view angle
CN114972483A (en) Lake sediment deposition amount monitoring method and device, electronic equipment and storage medium
Yang et al. A new method to identify the source vent location of tephra fall deposits: development, testing, and application to key Quaternary eruptions of Western North America
Pal et al. A prediction approach in adaptive sampling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination