Model training method based on spatial heterogeneity weight and cultivated land quality evaluation method
By using a model training method based on spatial heterogeneity weights, multi-branch features of cultivated land training data are extracted and dynamic weight analysis is performed. This solves the problems of insufficient accuracy and interpretability in cultivated land quality evaluation in existing technologies, and achieves a more accurate cultivated land quality evaluation.
Patent Information
- Application Number
- CN202510626127.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-05-15
AI Technical Summary
Existing technologies have failed to fully explore and utilize spatial contextual knowledge in arable land quality assessment, resulting in poor accuracy and interpretability of the assessment and difficulty in explaining the driving factors of differences in arable land quality in different spatial locations.
A model training method based on spatial heterogeneity weights is adopted. Through multi-branch feature extraction and dynamic weight analysis, the spatial heterogeneity weights of the first and second classification features are obtained, attention fusion is performed, and the farmland quality evaluation model is updated.
It improves the accuracy and interpretability of farmland quality assessment, enabling us to understand and explain the driving factors behind farmland quality differences in different spatial locations.
Smart Images

Figure CN120687827B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of soil quality evaluation, and in particular to a model training method based on spatial heterogeneity weight and a cultivated land quality evaluation method. BACKGROUND
[0002] With the rapid development of modern agriculture, cultivated land quality has become a key factor affecting agricultural production efficiency and sustainability. In order to comprehensively understand and master the cultivated land quality situation and scientifically guide agricultural production, cultivated land quality grade evaluation has become one of the focuses of relevant personnel.
[0003] At present, the related technology is usually based on a machine learning model or a deep learning model to directly learn and evaluate the quality of cultivated land data. This kind of way usually processes the spatial information of cultivated land data as ordinary input features, and fails to fully mine and utilize the spatial scenario knowledge contained in the spatial information. It is difficult to explain the driving factors of the differences in cultivated land quality at different spatial positions, and the accuracy and interpretability of cultivated land quality evaluation are not satisfactory.
[0004] Therefore, the problems of the related technology still need to be solved and optimized. SUMMARY
[0005] The purpose of the present application is to at least partially solve one of the technical problems in the related art.
[0006] To this end, one purpose of the embodiments of the present application is to provide a model training method based on spatial heterogeneity weight and a cultivated land quality evaluation method, wherein the training method provides a cultivated land quality evaluation model, which is beneficial to improve the accuracy and interpretability of cultivated land quality evaluation.
[0007] In order to achieve the above technical purpose, the technical solutions adopted by the embodiments of the present application include:
[0008] In a first aspect, the embodiments of the present application provide a model training method based on spatial heterogeneity weight, comprising:
[0009] obtaining cultivated land training data;
[0010] performing multi-branch feature extraction on the cultivated land training data to obtain a plurality of first classification features and second classification features, and a first spatial heterogeneity weight of the first classification features and a second spatial heterogeneity weight of the second classification features, the first spatial heterogeneity weight being negatively correlated with the spatial entropy of the corresponding first classification features, and the second spatial heterogeneity weight being positively correlated with the spatial entropy of the corresponding second classification features;
[0011] According to the cultivated land training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights, the first classification feature and the second classification feature are fused in attention to obtain a target fusion feature;
[0012] According to the target fusion feature, a initialized cultivated land quality evaluation model is updated in parameters to obtain a trained cultivated land quality evaluation model.
[0013] In addition, the method according to the above-mentioned embodiments of the application can have the following additional technical features:
[0014] Further, in an embodiment of the application, the multi-branch feature extraction on the cultivated land training data to obtain a plurality of first classification features and second classification features, and first spatial heterogeneity weights of the first classification features and second spatial heterogeneity weights of the second classification features comprises:
[0015] The multi-branch scale convolution extraction on the cultivated land training data to obtain a branch feature group;
[0016] The dynamic weight analysis processing on the branch feature group to obtain the first classification features and the first spatial heterogeneity weights of the first classification features, and the second classification features and the second spatial heterogeneity weights of the second classification features.
[0017] Further, in an embodiment of the application, the first branch convolution extraction on the cultivated land training data to obtain a first branch feature;
[0018] The second branch convolution extraction on the cultivated land training data to obtain a second branch feature;
[0019] The third branch convolution extraction on the cultivated land training data to obtain a third branch feature;
[0020] According to the first branch feature, the second branch feature and the third branch feature, the branch feature group is obtained;
[0021] Wherein, the convolution kernel corresponding to the first branch feature is smaller than the convolution kernel corresponding to the second branch feature, and the convolution kernel corresponding to the second branch feature is smaller than the convolution kernel corresponding to the third branch feature.
[0022] Further, in an embodiment of the application, the dynamic weight analysis processing on the branch feature group to obtain the first classification features and the first spatial heterogeneity weights of the first classification features, and the second classification features and the second spatial heterogeneity weights of the second classification features comprises:
[0023] perform local spatial entropy analysis on all branch features in the branch feature group to obtain a branch spatial entropy set of each branch feature, the branch spatial entropy set including a plurality of pixel spatial entropies, each pixel spatial entropy being used to represent spatial heterogeneity between the corresponding pixel of the branch feature and the neighborhood pixels;
[0024] perform spatial heterogeneity weight analysis on the branch spatial entropy set to obtain a branch weight corresponding to each branch feature of the branch feature group;
[0025] perform classification on the branch feature group and all the branch weights according to the branch spatial entropy set to obtain the first classification feature and a first spatial heterogeneity weight of the first classification feature, and the second classification feature and a second spatial heterogeneity weight of the second classification feature.
[0026] Further, in an embodiment of the present application, the branch weight includes a plurality of target pixel weights, and the spatial heterogeneity weight analysis on the branch spatial entropy set to obtain the branch weight corresponding to each branch feature of the branch feature group;
[0027] According to the branch spatial entropy set, a plurality of pixel spatial entropies of the same pixel position are obtained;
[0028] Weight calculation is performed on all the pixel spatial entropies of the same pixel position to obtain a plurality of intermediate pixel weights;
[0029] Normalization is performed on all the intermediate pixel weights to obtain a target pixel weight corresponding to each branch feature of the branch feature group, and the sum of all the target pixel weights of the same pixel position is equal to a weight threshold.
[0030] Further, in an embodiment of the present application, the attention fusion of the first classification feature and the second classification feature according to the cultivated land training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights to obtain a target fusion feature includes:
[0031] According to the first spatial heterogeneity weight, feature weighted fusion is performed on the first classification feature to obtain a first weighted feature;
[0032] According to the second spatial heterogeneity weight, feature weighted fusion is performed on the second classification feature to obtain a second weighted feature;
[0033] According to the first weighted feature and the second weighted feature, attention analysis processing is performed to obtain a target attention map;
[0034] According to the target attention map, feature fusion is performed on the cultivated land training data to obtain the target fusion feature.
[0035] Secondly, embodiments of this application provide a method for evaluating arable land quality, including:
[0036] Obtain evaluation element data for the cultivated land to be evaluated;
[0037] The evaluation element data is input into the trained farmland quality evaluation model to perform quality evaluation, and the original quality evaluation data output by the farmland quality evaluation model is obtained.
[0038] The original quality evaluation data is subjected to global and local spatial analysis to obtain the quality evaluation results of the cultivated land to be evaluated.
[0039] Thirdly, embodiments of this application provide a model training system based on spatial heterogeneity weights, comprising:
[0040] The first processing unit is used to acquire farmland training data;
[0041] The second processing unit is used to perform multi-branch feature extraction on the farmland training data to obtain several first classification features and second classification features, as well as the first spatial heterogeneity weight of the first classification feature and the second spatial heterogeneity weight of the second classification feature. The first spatial heterogeneity weight is negatively correlated with the spatial entropy of the corresponding first classification feature, and the second spatial heterogeneity weight is positively correlated with the spatial entropy of the corresponding second classification feature.
[0042] The third processing unit is used to perform attention fusion on the first classification feature and the second classification feature based on the farmland training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights, to obtain the target fusion feature;
[0043] The fourth processing unit is used to update the parameters of the initialized farmland quality evaluation model according to the target fusion features, so as to obtain a trained farmland quality evaluation model.
[0044] Fourthly, embodiments of this application also provide an electronic device, including:
[0045] At least one processor;
[0046] At least one memory for storing at least one program;
[0047] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0048] Fifthly, embodiments of this application also provide a computer-readable storage medium storing a processor-executable program, which, when executed by the processor, is used to implement the above-described method.
[0049] The advantages and beneficial effects of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application:
[0050] This application discloses a model training method and a farmland quality evaluation method based on spatial heterogeneity weights. The training method involves acquiring farmland training data; performing multi-branch feature extraction on the farmland training data to obtain several first classification features and second classification features, as well as first spatial heterogeneity weights for the first classification features and second spatial heterogeneity weights for the second classification features. The first spatial heterogeneity weights are negatively correlated with the spatial entropy of the corresponding first classification feature, and the second spatial heterogeneity weights are positively correlated with the spatial entropy of the corresponding second classification feature. Based on the farmland training data, all the first spatial heterogeneity weights, and the second spatial heterogeneity weights, attention fusion is performed on the first classification features and the second classification features to obtain target fusion features. Based on the target fusion features, the parameters of the initialized farmland quality evaluation model are updated to obtain a trained farmland quality evaluation model. This training method extracts features at multiple scales from farmland training data. Specifically, it extracts the first spatial heterogeneity weights, which are negatively correlated with the spatial entropy of the first classification feature, and the second spatial heterogeneity weights, which are positively correlated with the spatial entropy of the second classification feature. Then, it fuses the features at each scale based on the first and second spatial heterogeneity weights. This method is beneficial for mining and utilizing spatial contextual knowledge in the spatial information of farmland training data, enabling the model to accurately understand and explain the driving factors of farmland quality differences in different spatial locations, thereby improving the accuracy and interpretability of farmland quality evaluation. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of this application or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions in this application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0052] Figure 1 A schematic flowchart illustrating a model training method based on spatial heterogeneity weights provided in this application embodiment;
[0053] Figure 2A schematic diagram of the framework of a model training system based on spatial heterogeneity weights provided in an embodiment of this application;
[0054] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0055] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0057] Currently, related technologies are usually based on machine learning models or deep learning models to directly learn from and evaluate the quality of cultivated land data. This approach typically treats the spatial information of cultivated land data as ordinary input features, failing to fully recognize that cultivated land quality is affected by multiple spatial contextual factors such as the domain environment, geographical location, landscape pattern, and regional environmental background. In other words, it fails to fully explore and utilize the spatial contextual knowledge contained in the spatial information, making it difficult to explain the driving factors of differences in cultivated land quality in different spatial locations. As a result, the accuracy and interpretability of cultivated land quality evaluation are unsatisfactory.
[0058] Furthermore, some related technologies determine the fixed weights of each evaluation element of arable land quality through data-driven methods such as weight assignment, and then evaluate arable land quality based on the determined fixed weights and evaluation elements. This approach is difficult to effectively handle the complex relationships such as nonlinear relationships and interactions between evaluation elements, resulting in poor accuracy in arable land quality evaluation.
[0059] It should be noted that the aforementioned related technologies are only used to assist in understanding the technical solutions of this application and do not mean that they belong to the publicly disclosed prior art.
[0060] In view of this, embodiments of the present invention provide a model training method and a method for evaluating arable land quality based on spatial heterogeneity weights. This training method extracts multi-scale features from arable land training data, specifically extracting first spatial heterogeneity weights negatively correlated with the spatial entropy of the first classification feature and second spatial heterogeneity weights positively correlated with the spatial entropy of the second classification feature. Then, features at each scale are fused based on the first and second spatial heterogeneity weights. This facilitates the mining and utilization of spatial contextual knowledge within the spatial information of the arable land training data, enabling the model to accurately understand and explain the driving factors of arable land quality differences at different spatial locations, thereby improving the accuracy and interpretability of arable land quality evaluation.
[0061] Furthermore, this method is based on the spatial heterogeneity weight analysis of local spatial entropy, which allows the model to adaptively assign weights to scale features at different scales. Specifically, for regions with high spatial entropy, the model assigns higher dynamic weights to larger-scale scale features, which is beneficial for the model to capture complex and wide-area spatial patterns. For regions with low spatial entropy, the model assigns higher dynamic weights to smaller-scale scale features, which allows the model to more effectively focus on local fine features. This, in turn, helps the model to fully explore the complex relationships such as nonlinear relationships and interactions between evaluation elements, and improves the accuracy of farmland quality evaluation.
[0062] Reference Figure 1 In this application embodiment, a model training method based on spatial heterogeneity weights includes:
[0063] Step 110: Obtain farmland training data;
[0064] In this application embodiment, the farmland training data can be any type of multi-source, multi-scale spatial data of farmland area, specifically including at least one of environmental element data, land use / cover data, landscape pattern data, neighborhood feature data, spatial relationship raster data, and environmental background raster data. The environmental data includes slope, aspect, soil type, soil texture, soil nutrients, annual precipitation, air temperature, surface temperature, and normalized difference vegetation index (NDVI); land use / cover data includes land use type, cultivated land type, and plot boundaries; landscape pattern data can be landscape pattern indices calculated using landscape ecology software (such as Fragstats) based on land use / cover data, specifically including patch density, fragmentation, aggregation, diversity, and connectivity; neighborhood characteristic data can be neighborhood average soil organic matter content, neighborhood land use type diversity index, etc.; spatial relationship raster data can be raster data such as distance to rivers, distance to roads, distance to residential areas, and slope position level; environmental background raster data can be raster data such as regional climate type and regional geological conditions.
[0065] Step 120: Perform multi-branch feature extraction on the farmland training data to obtain several first classification features and second classification features, as well as the first spatial heterogeneity weight of the first classification feature and the second spatial heterogeneity weight of the second classification feature. The first spatial heterogeneity weight is negatively correlated with the spatial entropy of the corresponding first classification feature, and the second spatial heterogeneity weight is positively correlated with the spatial entropy of the corresponding second classification feature.
[0066] In this embodiment, features of farmland training data at different scales can be extracted through several parallel branches to obtain several first classification features and several second classification features, as well as a first spatial heterogeneity weight corresponding to each first classification feature and a second spatial heterogeneity weight corresponding to each second classification feature.
[0067] In some embodiments, the step of performing multi-branch feature extraction on the cultivated land training data to obtain several first classification features and second classification features, as well as the first spatial heterogeneity weights of the first classification features and the second spatial heterogeneity weights of the second classification features, includes:
[0068] Multi-branch scale convolution extraction is performed on the farmland training data to obtain branch feature groups;
[0069] Further, the cultivated land training data is subjected to first-branch convolution extraction to obtain first-branch features;
[0070] The second branch convolution is performed on the farmland training data to extract the second branch features;
[0071] The third-branch convolution extraction is performed on the farmland training data to obtain the third-branch features;
[0072] The branch feature group is obtained based on the first branch feature, the second branch feature, and the third branch feature;
[0073] In this embodiment, farmland training data can be extracted using parallel convolutional branches to form branch feature groups. For example, this embodiment uses 3 parallel convolutional branches. In this case, farmland training data can be extracted using a convolutional branch with a kernel size of 3×3 to obtain a first branch feature at a 3×3 convolutional scale; a second branch feature at a 5×5 convolutional scale can be extracted using a convolutional branch with a kernel size of 5×5; and a third branch feature at a 7×7 convolutional scale can be extracted using a convolutional branch with a kernel size of 7×7. The convolutional kernel corresponding to the second branch feature is smaller than the convolutional kernel corresponding to the third branch feature, meaning the convolutional scale of the third branch feature is larger than that of the second branch feature; the convolutional kernel corresponding to the first branch feature is smaller than the convolutional kernel corresponding to the second branch feature, meaning the convolutional scale of the second branch feature is larger than that of the first branch feature.
[0074] It should be noted that the examples in this application are for illustrative purposes only and do not limit the kernel size of each convolution branch or the number of convolution branches used. For example, the kernel size of the convolution branch can also be 2×2, 6×6, 8×8, etc., and the number of convolution branches used can also be 4, 5, 7, etc., which will not be elaborated here.
[0075] Dynamic weight analysis is performed on the branch feature group to obtain the first spatial heterogeneity weight of the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second spatial heterogeneity weight of the second classification feature and the second classification feature.
[0076] Further, the dynamic weight analysis processing of the branch feature group to obtain the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second spatial heterogeneity weight of the second classification feature, includes:
[0077] Local spatial entropy analysis is performed on all branch features in the branch feature group to obtain a branch spatial entropy set for each branch feature. The branch spatial entropy set includes several pixel spatial entropies, and each pixel spatial entropy is used to characterize the spatial heterogeneity between the pixel corresponding to the branch feature and its neighboring pixels.
[0078] In this embodiment of the application, if there are 3 parallel convolutional branches, the branch features in the branch feature group can be the first branch feature, the second branch feature, and the third branch feature, respectively. The first branch feature, the second branch feature, and the third branch feature are all feature maps constructed from several pixels. The local spatial entropy analysis can be to obtain the branch spatial entropy set of each branch feature, such as the branch spatial entropy set of the first branch feature, the branch spatial entropy set of the second branch feature, and the branch spatial entropy set of the third branch feature.
[0079] Specifically, for any pixel in the first branch feature, the spatial heterogeneity between the pixel and all its neighboring pixels (i.e., neighborhood pixels) in the feature map of the first branch feature can be calculated. This spatial heterogeneity is used to reflect the complexity of the spatial environment. Specifically, it is calculated by the probability distribution of the feature values of each neighboring pixel in the pixel, thereby obtaining the pixel spatial entropy of the pixel. The pixel spatial entropy of the other pixels is obtained in the same way. After obtaining the pixel spatial entropy of each pixel in the first branch feature, the pixel spatial entropy of all pixels can be integrated to obtain the branch spatial entropy set of the first branch feature. The branch spatial entropy sets of the second branch feature and the third branch feature are similar in content to the aforementioned branch spatial entropy set of the first branch feature, and can be simply deduced by analogy. This application will not elaborate further here.
[0080] For example, for the first branch feature, the pixel spatial entropy of a certain pixel of the first branch feature can be expressed as:
[0081]
[0082] in, The entropy of the pixel space; The coordinates of the pixel in the feature map of the first branch feature; Let be a variable, which is the label of the neighboring cell; For variables The maximum value is used to characterize the maximum number of neighboring pixels; For pixels The The probability distribution of the feature values of a neighborhood cell.
[0083] Spatial heterogeneity weight analysis is performed on the branch space entropy set to obtain the branch weight corresponding to each branch feature of the branch feature group;
[0084] Furthermore, the branch weights include several target cell weights, and the spatial heterogeneity weight analysis is performed on the branch spatial entropy set to obtain the branch weights corresponding to each branch feature of the branch feature group;
[0085] Based on the branch spatial entropy set, obtain the spatial entropy of several pixels at the same pixel position;
[0086] Weights are calculated for the spatial entropy of all pixels at the same location to obtain several intermediate pixel weights.
[0087] Normalize all the intermediate pixel weights to obtain the target pixel weights corresponding to each branch feature of the branch feature group. The sum of all the target pixel weights at the same pixel position is equal to the weight threshold.
[0088] In this embodiment, for each branch feature, the branch weight is a set of weights for several target pixel weights. Each target pixel weight is used to characterize the local spatial heterogeneity of the corresponding pixel at its pixel location in the feature map of the branch feature. Specifically, for a certain pixel location... First, we can obtain the spatial entropy set of this branch at the cell location. All pixel spatial entropies, each corresponding to a different branch feature; then, based on the pixel location The spatial entropy of all pixels is calculated, and the feature of each branch is calculated at that pixel location. The pixel weights on the graph are denoted as intermediate pixel weights. For example, in this embodiment of the application, the branch feature group includes the aforementioned first branch feature, second branch feature, and third branch feature. In this case, the pixel position... The weight of the intermediate pixels on the surface can be expressed as:
[0089]
[0090] in, For branch feature s at cell location The intermediate pixel weights on the graph, and the branch features s can specifically be the first branch feature, the second branch feature, or the third branch feature; For branch feature s at cell location Pixel space entropy; This is the symbol for an exponential function; As an indicator symbol, when When it is 3, The first branch feature at the cell location The entropy of the pixel space on; when When it is 5, For the second branch feature at the cell location Pixel space entropy; At 7 o'clock, The third branch feature at the cell location The entropy of the pixel space on the image.
[0091] It is understandable that, after obtaining the feature of each branch at the cell location... After assigning weights to the intermediate pixels, the weights of all intermediate pixels can be normalized, thus ensuring that the pixel position... The sum of the weights of all intermediate pixels is equal to a preset weight threshold, thus obtaining the target pixel weight corresponding to each branch feature. This preset weight threshold can be 1. Specifically, the relationship between the target pixel weight and the weight threshold can be:
[0092]
[0093] in, Let be the target cell weight of the branch feature s. Specifically, when s is 3, it can be the weight of the first branch feature at the cell position. The target cell weights; when s is 5, it can be the second branch feature at the cell position. The target cell weights; when s is 7, it can be the third branch feature at the cell position. The target cell weights.
[0094] It should be noted that the target pixel weights of each branch feature at other pixel locations are the same as those mentioned above at pixel locations. The content of the target cell weights is similar and can be easily deduced, so it will not be elaborated here. After obtaining the target cell weights of each branch feature at each cell position, the branch weights corresponding to each branch feature can be obtained by integrating all the target cell weights of each branch feature.
[0095] Based on the branch space entropy set, the branch feature group and all the branch weights are classified to obtain the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second classification feature and the second spatial heterogeneity weight of the second classification feature.
[0096] In this embodiment, after obtaining the branch spatial entropy set and corresponding branch weights for each branch feature in the branch feature group, each branch feature can be classified into a first classification feature or a second classification feature based on the correlation between the branch spatial entropy set and the corresponding branch weights. For example, taking the aforementioned first branch feature as a first classification feature and the aforementioned second and third branch features as second classification features as examples, the branch weights corresponding to the first branch feature are first spatial heterogeneity weights; the branch weights corresponding to the second branch feature are second spatial heterogeneity weights corresponding to the second classification feature with a 5×5 convolution scale; and the branch weights corresponding to the third branch feature are second spatial heterogeneity weights corresponding to the second classification feature with a 7×7 convolution scale.
[0097] It is understandable that, and it is worth mentioning, that for a region consisting of several pixels of a certain branch feature, this embodiment calculates the weights of the spatial entropy of all pixels at the same pixel location corresponding to different branch features. When facing regions with high local spatial heterogeneity (i.e., local spatial entropy), the model can assign higher weights to branch features with larger convolutional scales (such as second classification features) to capture complex and wide-area spatial patterns; that is, the spatial entropy of the second classification feature is positively correlated with the corresponding second spatial heterogeneity weight. Conversely, for regions with low local spatial heterogeneity, the model can assign higher weights to branch features with smaller convolutional scales (such as first classification features) to more effectively focus on local fine features; that is, the spatial entropy of the first classification feature is negatively correlated with the corresponding first spatial heterogeneity weight.
[0098] Step 130: Based on the farmland training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights, perform attention fusion on the first classification features and the second classification features to obtain the target fusion features;
[0099] In this embodiment of the application, the first classification feature and the second classification feature can be fused based on the attention mechanism and using the first spatial heterogeneity weight and the second spatial heterogeneity weight to obtain the target fused feature.
[0100] In some embodiments, the step of performing attention fusion on the first classification feature and the second classification feature based on the farmland training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights to obtain the target fusion feature includes:
[0101] Based on the first spatial heterogeneity weight, the first classification features are subjected to feature weighting and fusion to obtain the first weighted features;
[0102] Based on the second spatial heterogeneity weight, the second classification features are subjected to feature weighting and fusion to obtain the second weighted features;
[0103] Based on the first weighted feature and the second weighted feature, attention analysis is performed to obtain the target attention map;
[0104] Based on the target attention map, feature fusion is performed on the farmland training data to obtain the target fusion feature.
[0105] In the embodiments of this application, each first spatial heterogeneity weight can be weighted and fused with the corresponding first classification feature to obtain the first weighted feature. There are many specific weighting and fusion methods, such as element-wise multiplication. The second weighted feature is similar to the first weighted feature mentioned above and can be easily deduced by analogy. This application will not elaborate further here.
[0106] Understandably, after obtaining all the first-weighted features and second-weighted features, an element-wise summation operation can be performed on all the first-weighted features and second-weighted features. The resulting features are then subjected to a non-linear transformation using convolution and a sigmoid activation function to obtain the target attention map. Then, based on this target attention map, the feature maps of the farmland training data are multiplied element-wise to obtain the target fusion features.
[0107] Step 140: Update the parameters of the initialized farmland quality evaluation model according to the target fusion features to obtain the trained farmland quality evaluation model.
[0108] In this embodiment, after obtaining the target fusion features, prediction can be made on the target fusion features, and the parameters of the initialized farmland quality evaluation model can be updated based on the output prediction results, thereby obtaining a trained farmland quality evaluation model. Specifically, when training the model, a batch of farmland training data can be obtained, and the real label corresponding to each farmland training data can also be obtained. Then, each farmland training data and its corresponding real label can be used as a set of training data, the input data of the model is the farmland training data, the model predicts the farmland training data, and the output data of the model is the prediction result. After obtaining the prediction result output by the model, the accuracy of the model prediction can be evaluated based on the prediction result and the real label, and then the Adam optimization algorithm is used to update the parameters of the model. After several iterations, a trained farmland quality evaluation model can be obtained. The specific number of iterations can be preset, or training can be considered complete when the test set reaches the accuracy requirement.
[0109] This application provides a method for evaluating arable land quality, including:
[0110] Obtain evaluation element data for the cultivated land to be evaluated;
[0111] The evaluation element data is input into the trained farmland quality evaluation model to perform quality evaluation, and the original quality evaluation data output by the farmland quality evaluation model is obtained.
[0112] The original quality evaluation data is subjected to global and local spatial analysis to obtain the quality evaluation results of the cultivated land to be evaluated.
[0113] In this embodiment of the application, for a certain cultivated land to be evaluated, the evaluation element data of the cultivated land to be evaluated can be input into a trained cultivated land quality evaluation model for quality evaluation, thereby obtaining the original quality evaluation data output by the model; then, based on GeoShapley technology, the mechanical energy spatial context and interpretation of the original quality evaluation data output by the model are analyzed, thereby obtaining the quality evaluation result of the cultivated land to be evaluated.
[0114] Specifically, based on GeoShapley technology, the global average Shapley value of each evaluation element in the evaluation element data at different spatial locations can be calculated, as well as the local Shapley value of each average element at each spatial location. Then, based on all the calculated global average Shapley values and local Shapley values, a spatial feature importance ranking map, a spatial feature influence direction raster map, a spatial feature contribution raster map, and a spatial rule pattern map can be constructed. Based on the constructed diagrams, the quality evaluation results of the cultivated land to be evaluated can be obtained.
[0115] The following describes in detail, with reference to the accompanying drawings, a model training system based on spatial heterogeneity weights proposed according to an embodiment of this application.
[0116] Reference Figure 2 The training system for evaluating arable land quality proposed in this application includes:
[0117] The first processing unit 101 is used to acquire farmland training data;
[0118] The second processing unit 102 is used to perform multi-branch feature extraction on the farmland training data to obtain several first classification features and second classification features, as well as the first spatial heterogeneity weight of the first classification feature and the second spatial heterogeneity weight of the second classification feature. The first spatial heterogeneity weight is negatively correlated with the spatial entropy of the corresponding first classification feature, and the second spatial heterogeneity weight is positively correlated with the spatial entropy of the corresponding second classification feature.
[0119] The third processing unit 103 is used to perform attention fusion on the first classification feature and the second classification feature based on the farmland training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights, to obtain the target fusion feature;
[0120] The fourth processing unit 104 is used to update the parameters of the initialized farmland quality evaluation model according to the target fusion features, so as to obtain a trained farmland quality evaluation model.
[0121] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0122] Reference Figure 3 This application also provides an electronic device, including:
[0123] At least one processor 201;
[0124] At least one memory 202 is used to store at least one program;
[0125] When the at least one program is executed by the at least one processor 201, the at least one processor 201 implements the method embodiment described above.
[0126] Similarly, it can be understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0127] This application also provides a computer-readable storage medium storing a program executable by a processor 201, which, when executed by the processor 201, is used to implement the above-described method embodiments.
[0128] Similarly, the content of the above method embodiments is applicable to the present computer-readable storage medium embodiments. The specific functions implemented by the present computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0129] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0130] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding this application. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional technology for an engineer. Therefore, those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.
[0131] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0133] More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0134] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0135] In the foregoing description of this specification, the references to terms such as "one embodiment," "another embodiment," or "some embodiments," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0136] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
[0137] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A model training method based on spatial heterogeneity weights, characterized in that, include: Acquire farmland training data; The farmland training data refers to spatial data of any type of farmland area. This spatial data includes at least one of the following: environmental element data, land use / cover data, landscape pattern data, neighborhood characteristic data, spatial relationship raster data, and environmental background raster data. The environmental element data includes slope and aspect. The land use / cover data includes land use type and farmland type. The landscape pattern data includes patch density and fragmentation. The neighborhood characteristic data includes average soil organic matter content and neighborhood land use type diversity index. The spatial relationship raster data includes distance raster to rivers and distance raster to roads. The environmental background raster data includes regional climate type raster and regional geological condition raster. Multi-branch feature extraction is performed on the farmland training data to obtain several first classification features and second classification features, as well as the first spatial heterogeneity weight of the first classification feature and the second spatial heterogeneity weight of the second classification feature. The first spatial heterogeneity weight is negatively correlated with the spatial entropy of the corresponding first classification feature, and the second spatial heterogeneity weight is positively correlated with the spatial entropy of the corresponding second classification feature. Based on the farmland training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights, attention fusion is performed on the first classification features and the second classification features to obtain the target fusion features; Based on the target fusion features, the parameters of the initialized farmland quality evaluation model are updated to obtain the trained farmland quality evaluation model. The step of performing multi-branch feature extraction on the farmland training data to obtain several first classification features and second classification features, as well as the first spatial heterogeneity weights of the first classification features and the second spatial heterogeneity weights of the second classification features, includes: Multi-branch scale convolution extraction is performed on the farmland training data to obtain branch feature groups; Dynamic weight analysis is performed on the branch feature group to obtain the first spatial heterogeneity weight of the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second spatial heterogeneity weight of the second classification feature and the second classification feature. The dynamic weight analysis processing of the branch feature group to obtain the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second spatial heterogeneity weight of the second classification feature, includes: Local spatial entropy analysis is performed on all branch features in the branch feature group to obtain a branch spatial entropy set for each branch feature. The branch spatial entropy set includes several pixel spatial entropies, and each pixel spatial entropy is used to characterize the spatial heterogeneity between the pixel corresponding to the branch feature and its neighboring pixels. Spatial heterogeneity weight analysis is performed on the branch space entropy set to obtain the branch weight corresponding to each branch feature of the branch feature group; Based on the branch space entropy set, the branch feature group and all the branch weights are classified to obtain the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second classification feature and the second spatial heterogeneity weight of the second classification feature.
2. The method according to claim 1, characterized in that, The step of performing multi-branch scale convolution extraction on the farmland training data to obtain branch feature groups includes: The first branch convolution is performed on the farmland training data to extract the first branch features; The second branch convolution is performed on the farmland training data to extract the second branch features; The third-branch convolution extraction is performed on the farmland training data to obtain the third-branch features; The branch feature group is obtained based on the first branch feature, the second branch feature, and the third branch feature; Wherein, the convolution kernel corresponding to the first branch feature is smaller than the convolution kernel corresponding to the second branch feature, and the convolution kernel corresponding to the second branch feature is smaller than the convolution kernel corresponding to the third branch feature.
3. The method according to claim 1, characterized in that, The branch weights include several target pixel weights, and the spatial heterogeneity weight analysis is performed on the branch spatial entropy set to obtain the branch weights corresponding to each branch feature of the branch feature group; Based on the branch spatial entropy set, obtain the spatial entropy of several pixels at the same pixel position; Weights are calculated for the spatial entropy of all pixels at the same location to obtain several intermediate pixel weights. Normalize all the intermediate pixel weights to obtain the target pixel weights corresponding to each branch feature of the branch feature group. The sum of all the target pixel weights at the same pixel position is equal to the weight threshold.
4. The method according to claim 1, characterized in that, The step of performing attention fusion on the first classification features and the second classification features based on the farmland training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights, to obtain target fusion features includes: Based on the first spatial heterogeneity weight, the first classification features are subjected to feature weighting and fusion to obtain the first weighted features; Based on the second spatial heterogeneity weight, the second classification features are subjected to feature weighting and fusion to obtain the second weighted features; Based on the first weighted feature and the second weighted feature, attention analysis is performed to obtain the target attention map; Based on the target attention map, feature fusion is performed on the farmland training data to obtain the target fusion feature.
5. A method for evaluating arable land quality, characterized in that, include: Obtain evaluation element data for the cultivated land to be evaluated; The evaluation element data is input into the trained farmland quality evaluation model as described in any one of claims 1-4 to perform quality evaluation, and the original quality evaluation data output by the farmland quality evaluation model is obtained. The original quality evaluation data is subjected to global and local spatial analysis to obtain the quality evaluation results of the cultivated land to be evaluated.
6. A model training system based on spatial heterogeneity weights, characterized in that, include: The first processing unit is used to acquire farmland training data; The farmland training data refers to spatial data of any type of farmland area. This spatial data includes at least one of the following: environmental element data, land use / cover data, landscape pattern data, neighborhood characteristic data, spatial relationship raster data, and environmental background raster data. The environmental element data includes slope and aspect. The land use / cover data includes land use type and farmland type. The landscape pattern data includes patch density and fragmentation. The neighborhood characteristic data includes average soil organic matter content and neighborhood land use type diversity index. The spatial relationship raster data includes distance raster to rivers and distance raster to roads. The environmental background raster data includes regional climate type raster and regional geological condition raster. The second processing unit is used to perform multi-branch feature extraction on the farmland training data to obtain several first classification features and second classification features, as well as the first spatial heterogeneity weight of the first classification feature and the second spatial heterogeneity weight of the second classification feature. The first spatial heterogeneity weight is negatively correlated with the spatial entropy of the corresponding first classification feature, and the second spatial heterogeneity weight is positively correlated with the spatial entropy of the corresponding second classification feature. The third processing unit is used to perform attention fusion on the first classification feature and the second classification feature based on the farmland training data, all the first spatial heterogeneity weights and the second spatial heterogeneity weights, to obtain the target fusion feature; The fourth processing unit is used to update the parameters of the initialized farmland quality evaluation model according to the target fusion features, so as to obtain the trained farmland quality evaluation model. The step of performing multi-branch feature extraction on the farmland training data to obtain several first classification features and second classification features, as well as the first spatial heterogeneity weights of the first classification features and the second spatial heterogeneity weights of the second classification features, includes: Multi-branch scale convolution extraction is performed on the farmland training data to obtain branch feature groups; Dynamic weight analysis is performed on the branch feature group to obtain the first spatial heterogeneity weight of the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second spatial heterogeneity weight of the second classification feature and the second classification feature. The dynamic weight analysis processing of the branch feature group to obtain the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second spatial heterogeneity weight of the second classification feature, includes: Local spatial entropy analysis is performed on all branch features in the branch feature group to obtain a branch spatial entropy set for each branch feature. The branch spatial entropy set includes several pixel spatial entropies, and each pixel spatial entropy is used to characterize the spatial heterogeneity between the pixel corresponding to the branch feature and its neighboring pixels. Spatial heterogeneity weight analysis is performed on the branch space entropy set to obtain the branch weight corresponding to each branch feature of the branch feature group; Based on the branch space entropy set, the branch feature group and all the branch weights are classified to obtain the first classification feature and the first spatial heterogeneity weight of the first classification feature, and the second classification feature and the second spatial heterogeneity weight of the second classification feature.
7. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1-5.
8. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Multi-scale earth surface complexity feature extraction and land utilization segmentation method
CN115984689A
Land utilization category classification method and device and storage medium
CN119006876A