Method and device for determining soil components of to-be-predicted area and storage medium

By using an image prediction model based on a swin-unet grid structure and an attention mechanism, combined with meteorological, topographical, and remote sensing data, soil composition can be determined quickly and accurately, solving the problems of long time consumption, high cost, and large error in traditional methods.

CN119600404AActive Publication Date: 2025-03-11ZHONGLIAN SMART AGRI CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411665800.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-11
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

Traditional soil composition analysis methods are time-consuming, costly, and prone to errors, making it impossible to accurately obtain the actual soil composition.

Method used

An image prediction model based on the swin-unet grid structure is adopted. The image data is downsampled and upsampled by the encoder and decoder. The attention mechanism module is combined to identify effective and ineffective features. The model is then fused with meteorological, topographic and remote sensing data to determine the soil composition.

Benefits of technology

It enables rapid and accurate determination of soil composition, reduces human intervention, lowers labor costs, and improves identification speed and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600404A_ABST
    Figure CN119600404A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of soil science, in particular to a method and device for determining soil components of a to-be-predicted area and a storage medium. Comprising the following steps: inputting image data into an encoder of an image prediction model to obtain a down-sampled feature map, and respectively inputting the down-sampled feature map into a decoder and an attention mechanism module; the decoder performs up-sampling processing on the down-sampled feature map to obtain an up-sampled feature map; the attention mechanism module identifies valid features and invalid features in the down-sampled feature map, and inputs the valid features and the invalid features to the decoder; the decoder fuses the effective features, the invalid features and the up-sampled feature map to obtain a predicted soil feature map of the to-be-predicted region; and determining the soil components of the to-be-predicted region according to the predicted soil feature map, so as to quickly and accurately determine the soil components of the to-be-predicted region, reduce artificial participation, reduce labor cost, and improve identification speed and identification precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of soil science and technology, and in particular to a method, device and storage medium for determining the soil composition of a region to be predicted. Background Art

[0002] Soil is one of the important natural resources on the earth's surface, and is of great significance to agricultural production, ecological environment protection, and geological research. Traditional soil composition analysis usually relies on laboratory analysis such as chemical analysis, physical testing, and spectral analysis. These methods require the collection of soil samples and tedious laboratory operations and data processing to obtain soil composition, which consumes a lot of time and human resources and relies heavily on equipment and professional knowledge. In addition, the existing soil composition analysis technology is overly dependent on the experimental environment, resulting in a large gap between the soil composition analysis results and reality, and the actual soil composition cannot be accurately obtained. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method, device and storage medium for determining the soil composition of an area to be predicted, so as to solve the problems in the prior art of soil composition identification that are time-consuming, costly and have large errors.

[0004] In order to achieve the above-mentioned object, the first aspect of the present application provides a method for determining the soil composition of a region to be predicted, the method comprising:

[0005] Obtain image data of the area to be predicted;

[0006] Input the image data into the encoder of the image prediction model to obtain a downsampled feature map, wherein the image prediction model also includes an attention mechanism module and a decoder;

[0007] The encoder inputs the downsampled feature map into the decoder and attention mechanism module respectively;

[0008] The decoder performs upsampling on the downsampled feature map to obtain an upsampled feature map;

[0009] The attention mechanism module identifies the valid features and invalid features in the downsampled feature map and inputs the valid features and invalid features into the decoder;

[0010] The decoder fuses the valid features, invalid features and upsampled feature maps to obtain the predicted soil feature map of the area to be predicted;

[0011] Determine the soil composition of the area to be predicted based on the predicted soil characteristic map.

[0012] In an embodiment of the present application, the image prediction model is a model based on the swin-unet grid structure.

[0013] In an embodiment of the present application, the encoder and the decoder have a symmetrical structure, the encoder includes multiple layers of first network layers, the decoder includes a second network layer corresponding to each first network layer, and an attention mechanism module is connected between each first network layer and the corresponding second network layer. The encoder inputs the downsampled feature map into the decoder and the attention mechanism module respectively, including: the multiple layers of the first network layer input the downsampled first sub-feature map into the corresponding attention mechanism module and the second network layer respectively.

[0014] In an embodiment of the present application, the decoder upsamples the downsampled feature map to obtain the upsampled feature map, including: multiple layers of second network layers upsample the received first sub-feature map respectively to obtain the upsampled second sub-feature map.

[0015] In an embodiment of the present application, the attention mechanism module identifies valid features and invalid features in the downsampled feature map, and inputs the valid features and invalid features to the decoder, including: for any first network layer in the multi-layer first network layer, the attention mechanism module corresponding to the first network layer identifies invalid features and valid features in the first sub-feature map of the first network layer, and inputs the valid features and invalid features in the first sub-feature map of the first network layer to the second network layer corresponding to the first network layer.

[0016] In an embodiment of the present application, the decoder fuses the valid features, invalid features and upsampled feature maps to obtain a predicted soil feature map of the area to be predicted, including: each second network layer in the multiple layers of second network layers fuses the second sub-feature map, valid features and invalid features of the second network layer to obtain a fused third sub-feature map; and determines the predicted soil feature map based on the third sub-feature maps of all second network layers.

[0017] In an embodiment of the present application, determining the soil composition of the area to be predicted based on the predicted soil characteristic map includes: obtaining meteorological data, topographic data, and remote sensing data of the area to be predicted; inputting the meteorological data, topographic data, and remote sensing data into a machine learning model to obtain a prediction result of the machine learning model on the soil composition of the area to be predicted; and determining the soil composition based on the prediction result and the predicted soil characteristic map.

[0018] In an embodiment of the present application, determining the soil composition based on the prediction results and the predicted soil characteristic map includes: extracting a first sub-soil composition of the area to be predicted from the prediction results, and extracting a second sub-soil composition of the area to be predicted from the predicted soil characteristic map; and fusing the first sub-soil composition and the second sub-soil composition to obtain the soil composition.

[0019] A second aspect of the present application provides a device for determining soil composition of a region to be predicted, comprising:

[0020] a memory configured to store instructions;

[0021] The processor is configured to call instructions from the memory and implement the above method for determining the soil composition of the area to be predicted when executing the instructions.

[0022] A third aspect of the present application provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the above-mentioned method for determining the soil composition of an area to be predicted.

[0023] Through the above technical scheme, the image data can be downsampled through the encoder in the image prediction model to obtain the downsampled feature map, and the downsampled feature map is respectively input into the decoder and the attention mechanism module in the image prediction model; the decoder performs upsampling processing on the downsampled feature map to obtain the upsampled feature map; the attention mechanism module identifies the valid features and invalid features in the downsampled feature map, and inputs the valid features and invalid features into the decoder; the decoder fuses the valid features, invalid features and the upsampled feature map to obtain the predicted soil feature map of the area to be predicted; the soil composition of the area to be predicted is determined according to the predicted soil feature map, so as to quickly and accurately determine the soil composition of the area to be predicted, reduce manual participation, reduce labor costs, and improve recognition speed and recognition accuracy.

[0024] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

[0026] Figure 1 A schematic diagram of a flow chart of a method for determining soil composition of a region to be predicted according to an embodiment of the present application is shown;

[0027] Figure 2 Another schematic flow chart of a method for determining soil composition of a region to be predicted according to an embodiment of the present application is schematically shown;

[0028] Figure 3 A schematic diagram of the structure of a swin-unet grid structure according to an embodiment of the present application is schematically shown;

[0029] Figure 4The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0031] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0032] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0033] Figure 1 The following is a schematic diagram showing a flow chart of a method for determining soil composition of a region to be predicted according to an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides a method for determining the soil composition of an area to be predicted, and the method may include the following steps.

[0034] Step 101: Obtain image data of the area to be predicted.

[0035] Step 102: Input the image data into the encoder of the image prediction model to obtain a downsampled feature map, wherein the image prediction model also includes an attention mechanism module and a decoder.

[0036] Step 103: The encoder inputs the downsampled feature map into the decoder and attention mechanism module respectively.

[0037] The processor can obtain image data of the area to be predicted, for example, it can obtain image data of the area to be predicted collected by a drone, and it can also collect image data of the area to be predicted through image acquisition equipment such as a camera. After obtaining the image data of the area to be predicted, the processor can input the image data into the encoder of the image prediction model to downsample the image data through the encoder to obtain a downsampled feature map. Among them, the image prediction model can also include an attention mechanism module and a decoder. In a specific embodiment, the image prediction model can be a model based on the swin-unet (Transformer-based medical image segmentation model) grid structure. After obtaining the downsampled feature map, the encoder can input the downsampled feature map into the decoder and the attention mechanism module respectively.

[0038] In an embodiment of the present application, the encoder and the decoder have a symmetrical structure, the encoder includes multiple layers of first network layers, the decoder includes a second network layer corresponding to each first network layer, and an attention mechanism module is connected between each first network layer and the corresponding second network layer. The encoder inputs the downsampled feature map into the decoder and the attention mechanism module respectively, including: the multiple layers of the first network layer input the downsampled first sub-feature map into the corresponding attention mechanism module and the second network layer respectively.

[0039] The encoder and the decoder may have a symmetrical structure. The encoder may include multiple layers of the first network layer, the decoder may include a second network layer corresponding to each layer of the first network layer, and an attention mechanism module is connected between each layer of the first network layer and the corresponding second network layer. The encoder may input the downsampled feature map to the decoder and the attention mechanism module respectively. Specifically, the multiple layers of the first network layer in the encoder may downsample the image data to obtain a first sub-feature map. After obtaining the first sub-feature map, the multiple layers of the first network layer in the encoder may input the first sub-feature map to the corresponding attention mechanism module and the second network layer respectively.

[0040] In an embodiment of the present application, the decoder upsamples the downsampled feature map to obtain the upsampled feature map, including: multiple layers of second network layers upsample the received first sub-feature map respectively to obtain the upsampled second sub-feature map.

[0041] The decoder may perform upsampling processing on the downsampled feature map to obtain an upsampled feature map. Specifically, the multi-layer second network layer in the decoder may respectively receive the corresponding first sub-feature map, and perform upsampling processing on the received first sub-feature map to obtain an upsampled second sub-feature map.

[0042] In an embodiment of the present application, the attention mechanism module identifies valid features and invalid features in the downsampled feature map, and inputs the valid features and invalid features to the decoder, including: for any first network layer in the multi-layer first network layer, the attention mechanism module corresponding to the first network layer identifies invalid features and valid features in the first sub-feature map of the first network layer, and inputs the valid features and invalid features in the first sub-feature map of the first network layer to the second network layer corresponding to the first network layer.

[0043] The attention mechanism module can identify valid features and invalid features in the downsampled feature map, and input the valid features and invalid features to the decoder. Specifically, for any first network layer in the multi-layer first network layer, the attention mechanism module corresponding to the first network layer can identify invalid features and valid features in the first sub-feature map in the first network layer, and input the valid features and invalid features in the first sub-feature map of the first network layer to the second network layer corresponding to the first network layer.

[0044] In an embodiment of the present application, the decoder fuses the valid features, invalid features and upsampled feature maps to obtain a predicted soil feature map of the area to be predicted, including: each second network layer in the multiple layers of second network layers fuses the second sub-feature map, valid features and invalid features of the second network layer to obtain a fused third sub-feature map; and determines the predicted soil feature map based on the third sub-feature maps of all second network layers.

[0045] The decoder can fuse the valid features, invalid features and upsampled feature maps to obtain a predicted soil feature map of the area to be predicted. Specifically, each second network layer in the multiple layers of the second network layers in the decoder fuses the second sub-feature map, valid features and invalid features in the second network layer to obtain a fused third sub-feature map. After obtaining the third sub-feature map of each second network layer, the decoder can determine the predicted soil feature map based on the third sub-feature maps of all second network layers to enrich the features in the predicted soil feature map, making the features in the predicted soil feature map more meaningful and facilitating the analysis of soil composition.

[0046] Step 104: The decoder performs upsampling processing on the downsampled feature map to obtain an upsampled feature map.

[0047] Step 105: The attention mechanism module identifies the valid features and invalid features in the downsampled feature map, and inputs the valid features and invalid features into the decoder.

[0048] Step 106: The decoder fuses the valid features, invalid features and the upsampled feature map to obtain a predicted soil feature map of the area to be predicted.

[0049] Step 107: Determine the soil composition of the area to be predicted based on the predicted soil characteristic map.

[0050] The decoder can receive the downsampled feature map input by the encoder, and perform upsampling on the downsampled feature map to obtain the upsampled feature map. The attention mechanism module can receive the downsampled feature map input by the encoder, identify the valid features and invalid features in the downsampled feature map, and input the valid features and invalid features to the decoder. In an optional embodiment, the attention mechanism module can calculate the importance score of each feature in the downsampled feature map, and determine the features with an importance score greater than or equal to a preset value as valid features, and determine the features with an importance score less than a preset value as invalid features. The preset value can be determined based on the soil of the area to be predicted. The decoder can receive the valid features and invalid features input by the attention mechanism module, and fuse the valid features, invalid features and the upsampled feature map to obtain the predicted soil feature map of the area to be predicted. After obtaining the predicted soil feature map of the area to be predicted, the processor can determine the soil composition of the area to be predicted according to the predicted soil feature map of the area to be predicted. The soil composition may include the pH value, organic matter, phosphorus, potassium, calcium, magnesium, etc. of the soil in the area to be predicted.

[0051] In an embodiment of the present application, determining the soil composition of the area to be predicted based on the predicted soil characteristic map includes: obtaining meteorological data, topographic data, and remote sensing data of the area to be predicted; inputting the meteorological data, topographic data, and remote sensing data into a machine learning model to obtain a prediction result of the machine learning model on the soil composition of the area to be predicted; and determining the soil composition based on the prediction result and the predicted soil characteristic map.

[0052] The processor can determine the soil composition of the area to be predicted based on the predicted soil characteristic map. Specifically, the processor can obtain meteorological data, topographic data and remote sensing data of the area to be predicted. The meteorological data can be meteorological data with a resolution of 10 meters, which can be measured by a small meteorological station installed in the area to be predicted, and can specifically include temperature, humidity, rainfall, etc. The topographic data can be provided by SRTM (Shuttle Radar Topography Mission), and can include elevation, slope, slope aspect, profile curvature, terrain curvature, soil thickness, terrain undulation, surface roughness and terrain moisture index, etc. The remote sensing data can be the normalized vegetation index (NDVI index) of the area to be predicted calculated based on the visible light data, near infrared band data and thermal infrared band data of the Sentinel-2 satellite, which is used to evaluate the vegetation growth of the area to be predicted, as well as the soil moisture and soil surface temperature calculated by the thermal infrared band data. After obtaining the meteorological data, topographic data and remote sensing data of the area to be predicted, the processor can input the meteorological data, topographic data and remote sensing data into the machine learning model to obtain the prediction result of the machine learning model on the soil composition of the area to be predicted. After obtaining the prediction result of the soil composition of the area to be predicted by the machine learning model, the processor can determine the soil composition according to the prediction result and the predicted soil characteristic map. In an optional embodiment, the processor can perform a weighted average of the prediction result of the soil composition obtained by the machine learning model and the soil composition obtained by the predicted soil characteristic map to serve as the final soil composition of the area to be predicted.

[0053] In an embodiment of the present application, determining the soil composition based on the prediction results and the predicted soil characteristic map includes: extracting a first sub-soil composition of the area to be predicted from the prediction results, and extracting a second sub-soil composition of the area to be predicted from the predicted soil characteristic map; and fusing the first sub-soil composition and the second sub-soil composition to obtain the soil composition.

[0054] The processor may determine the soil composition according to the prediction result and the predicted soil characteristic map. Specifically, the processor may extract a first sub-soil composition of the area to be predicted from the prediction result, and extract a second sub-soil composition of the area to be predicted from the predicted soil characteristic map. After obtaining the first sub-soil composition and the second sub-soil composition, the processor may fuse the first sub-soil composition and the second sub-soil composition to obtain the soil composition of the area to be predicted.

[0055] In one embodiment, Figure 2As shown, the area to be predicted can be a plot of land in a farm. The processor can obtain the meteorological station data of the plot through various meteorological stations located in the farm, and the meteorological station data includes temperature, precipitation, and humidity, etc.; obtain the terrain data of the plot, and the terrain data includes elevation, slope, slope aspect, profile curvature, terrain curvature, soil thickness, terrain undulation, surface roughness, and terrain humidity index, etc.; obtain satellite remote sensing data of the plot, and the satellite remote sensing data includes NDVI index, surface temperature, and soil humidity, etc.; obtain drone data, that is, image data taken by drones flying over the farm, which can include hyperspectral image data, multispectral image data, etc.

[0056] The processor can also divide the farm into multiple grids with a resolution of 30 meters based on the map data of the farm. The size of each grid can be a square area of ​​30 meters * 30 meters. Then, the processor can randomly sample from the grid inside each plot, and the number of sampling points in each plot can be one-fifth of the grid data inside each plot. When the calculated result of the number of sampling points of a certain plot is less than 1, the processor can sample the plot once, that is, there is at least one sampling point in each plot. The processor can obtain the soil sampling data of each sampling point, including the pH value, organic matter, phosphorus, potassium, calcium, magnesium, etc. of the soil, and use it as a label value to combine meteorological station data, terrain data and satellite remote sensing data to train the machine learning algorithm, and combine drone data to train the Transformer image prediction algorithm. Finally, the trained machine learning algorithm and the Transformer image prediction algorithm are used for joint prediction to determine the soil composition of the plot.

[0057] Specifically, the training of the machine learning algorithm can be based on the longitude, latitude, humidity, temperature, rainfall, elevation, slope, aspect, profile curvature, terrain curvature, soil thickness, terrain undulation, surface roughness, terrain moisture index, NDVI index, soil moisture and surface temperature of the sampling point as training features, and the target values ​​are soil pH, organic matter, phosphorus, potassium, phosphorus and magnesium. The regression loss function can be the MSE function, that is, Among them, L mse is the loss value when the machine learning algorithm is trained, m is the number of training samples when the machine learning algorithm is trained, and y i is the actual soil composition of the i-th training sample during machine learning algorithm training, y Δ i is the predicted soil composition of the i-th training sample when training the machine learning algorithm.

[0058] The Transformer image prediction algorithm can use the swin-unet network structure. Figure 3As shown in the figure, at the encoder end of the swin-unet network structure, the input drone image of size 512×512×9 is firstly PatchPartitioned to obtain multiple small block images of size 64×64×576. Then these small blocks are processed by LinearEmbedding and three Swin Transformer block2s (shifted window transform modules v2) to generate feature maps of size 32×32×256. Then, the size of the feature map is changed to 16×16×512 by Patch Merging, and then the feature map is further reduced to 8×8×1024 by three Swin Transformer block2s. Finally, the size of the feature map is changed to 4×4×2056 by Patch Merging, that is, the size of the feature map finally output by the encoder is 4×4×2056.

[0059] The feature map of the encoder’s final output is processed by two consecutive Swin Transformer blocks2 in the Bottleneck part of the swin-unet network structure. Specifically, the feature map output by the encoder is transformed and nonlinearly operated to enhance the expressiveness of the features while keeping the size of the feature map at 4×4×2056.

[0060] At the decoder end of the swin-unet network structure, the 4×4×2056 feature map is upsampled by Patch Expanding and three Swin Transformer block2s to expand the size of the feature map to 8×8×1024. At the same time, the three Swin Transformer block2s on the encoder end, which are symmetrical to the three Swin Transformer block2s, identify valid and invalid features through the attention mechanism module (AG, Attention Gage) on the downsampled size of 8×8×1024, and input the identified valid and invalid features into the decoder to perform A (Add, fusion) processing with the upsampled size of 8×8×1024 feature map to achieve the purpose of information fusion. The fused 8×8×1024 feature map is upsampled again by Patch Expanding and three Swin Transformerblock2s to obtain a feature map of size 16×16×512. At the same time, the three Swin Transformer block2s on the encoder side symmetrical to the three Swin Transformer block2s identify valid and invalid features through the attention mechanism module (AG, Attention Gage) for the downsampled size of 16×16×512, and input the identified valid and invalid features into the decoder to perform A (Add, fusion) processing with the upsampled feature map of size 16×16×512 to obtain a fused feature map of size 16×16×512. The fused feature map of size 16×16×512 is upsampled again through Patch Expanding and three Swin Transformer block2s to obtain a feature map of size 32×32×256. At the same time, the three Swin Transformer block2s on the encoder side symmetrical to the three Swin Transformerblock2s identify valid and invalid features through the attention mechanism module (AG, Attention Gage) after downsampling to a size of 32×32×256, and input the identified valid and invalid features into the decoder for A (Add, fusion) processing with the feature map of size 32×32×256 after upsampling to obtain a fused feature map of size 32×32×256.Then, the fused feature map of size 32×32×256 is processed by Patch Expanding to expand the size of the 32×32×256 feature to 512×512×256, and Linear Project is processed to obtain a feature map of size 512×512×6 output by the decoder. In each of the above fusion processes, a Patch Expanding is used to restore the details in the feature map to improve the accuracy of the fusion. Among them, the loss function of the Transformer image prediction algorithm is L. all =0.6*L c +0.4*L nc , where L all is the loss value of the Transformer image prediction algorithm, L c is the loss of the sampling point, L nc is the loss of non-sampling points.

[0061] Through the above technical solution, the soil composition of the area to be predicted can be determined quickly and accurately, and manual participation can be reduced, labor costs can be reduced, and recognition speed and accuracy can be improved.

[0062] Figure 1 and Figure 2 FIG. 1 is a flow chart of a method for determining soil composition of a region to be predicted in one embodiment. Figure 1 and Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 and Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0063] The present application also provides a device for determining soil composition of a region to be predicted, comprising:

[0064] a memory configured to store instructions;

[0065] The processor is configured to call instructions from the memory and implement the above method for determining the soil composition of the area to be predicted when executing the instructions.

[0066] An embodiment of the present application also provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the above-mentioned method for determining the soil composition of the area to be predicted.

[0067] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the computer device is used to store image data, feature maps, valid data, invalid data, predicted soil feature maps, soil composition and other data. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a method for determining the soil composition of an area to be predicted is implemented.

[0068] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0069] An embodiment of the present application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: acquiring image data of an area to be predicted; inputting the image data into an encoder of an image prediction model to obtain a downsampled feature map, wherein the image prediction model also includes an attention mechanism module and a decoder; the encoder inputs the downsampled feature map into the decoder and the attention mechanism module respectively; the decoder performs upsampling processing on the downsampled feature map to obtain an upsampled feature map; the attention mechanism module identifies valid features and invalid features in the downsampled feature map, and inputs the valid features and invalid features into the decoder; the decoder fuses the valid features, invalid features, and the upsampled feature map to obtain a predicted soil feature map of the area to be predicted; and determines the soil composition of the area to be predicted based on the predicted soil feature map.

[0070] In one embodiment, the image prediction model is a model based on a swin-unet grid structure.

[0071] In one embodiment, the encoder and the decoder are symmetrical structures, the encoder includes multiple layers of first network layers, the decoder includes a second network layer corresponding to each first network layer, and an attention mechanism module is connected between each first network layer and the corresponding second network layer. The encoder inputs the downsampled feature map to the decoder and the attention mechanism module respectively, including: the multiple layers of the first network layer input the downsampled first sub-feature map to the corresponding attention mechanism module and the second network layer respectively.

[0072] In one embodiment, the decoder upsamples the downsampled feature map to obtain the upsampled feature map, including: multiple layers of second network layers upsample the received first sub-feature map respectively to obtain the upsampled second sub-feature map.

[0073] In one embodiment, the attention mechanism module identifies valid features and invalid features in the downsampled feature map, and inputs the valid features and invalid features to the decoder, including: for any first network layer in the multi-layer first network layer, the attention mechanism module corresponding to the first network layer identifies invalid features and valid features in the first sub-feature map of the first network layer, and inputs the valid features and invalid features in the first sub-feature map of the first network layer to the second network layer corresponding to the first network layer.

[0074] In one embodiment, the decoder fuses the valid features, invalid features and upsampled feature maps to obtain a predicted soil feature map of the area to be predicted, including: each second network layer in the multiple layers of second network layers fuses the second sub-feature map, valid features and invalid features of the second network layer to obtain a fused third sub-feature map; and determines the predicted soil feature map based on the third sub-feature maps of all second network layers.

[0075] In one embodiment, determining the soil composition of the area to be predicted based on the predicted soil characteristic map includes: obtaining meteorological data, topographic data and remote sensing data of the area to be predicted; inputting the meteorological data, topographic data and remote sensing data into a machine learning model to obtain a prediction result of the machine learning model on the soil composition of the area to be predicted; and determining the soil composition based on the prediction result and the predicted soil characteristic map.

[0076] In one embodiment, determining soil composition based on prediction results and predicted soil characteristic maps includes: extracting a first sub-soil composition of the area to be predicted from the prediction results, and extracting a second sub-soil composition of the area to be predicted from the predicted soil characteristic map; and fusing the first sub-soil composition and the second sub-soil composition to obtain the soil composition.

[0077] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initiates the method steps for determining the soil composition of an area to be predicted.

[0078] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0079] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0082] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0083] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0084] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0085] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0086] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for determining the soil composition of an area to be predicted, characterized in that The method comprises: Obtain image data of the area to be predicted; Inputting the image data into an encoder of an image prediction model to obtain a downsampled feature map, wherein the image prediction model further includes an attention mechanism module and a decoder; The encoder inputs the downsampled feature map to the decoder and the attention mechanism module respectively; The decoder performs upsampling processing on the downsampled feature map to obtain an upsampled feature map; The attention mechanism module identifies valid features and invalid features in the downsampled feature map, and inputs the valid features and the invalid features into the decoder; The decoder fuses the valid features, the invalid features and the upsampled feature map to obtain a predicted soil feature map of the area to be predicted; The soil composition of the area to be predicted is determined according to the predicted soil characteristic map.

2. The method for determining soil composition of a region to be predicted according to claim 1, characterized in that: The image prediction model is a model based on the swin-unet grid structure.

3. The method for determining soil composition of a region to be predicted according to claim 1, characterized in that: The encoder and the decoder are symmetrical structures. The encoder includes multiple first network layers, and the decoder includes a second network layer corresponding to each first network layer. An attention mechanism module is connected between each first network layer and the corresponding second network layer. The encoder inputs the downsampled feature map to the decoder and the attention mechanism module respectively, including: The multi-layer first network layer inputs the downsampled first sub-feature map into the corresponding attention mechanism module and the second network layer respectively.

4. The method for determining soil composition of a region to be predicted according to claim 3, characterized in that: The decoder performs upsampling processing on the downsampled feature map to obtain the upsampled feature map, including: The multi-layer second network layers respectively upsample the received first sub-feature map to obtain an upsampled second sub-feature map.

5. The method for determining soil composition of a region to be predicted according to claim 4, characterized in that: The attention mechanism module identifies valid features and invalid features in the downsampled feature map, and inputs the valid features and the invalid features into the decoder, including: For any first network layer in the multi-layer first network layers, the attention mechanism module corresponding to the first network layer identifies the invalid features and valid features in the first sub-feature map of the first network layer, and inputs the valid features and invalid features in the first sub-feature map of the first network layer into the second network layer corresponding to the first network layer.

6. The method for determining soil composition of a region to be predicted according to claim 5, characterized in that: The decoder fuses the valid features, the invalid features and the upsampled feature map to obtain the predicted soil feature map of the area to be predicted, including: Each second network layer in the multiple layers of the second network layers fuses the second sub-feature graph, the valid features, and the invalid features of the second network layer to obtain a fused third sub-feature graph; The predicted soil characteristic map is determined according to the third sub-characteristic maps of all second network layers.

7. The method for determining soil composition of a region to be predicted according to claim 1, characterized in that: Determining the soil composition of the area to be predicted according to the predicted soil characteristic map comprises: Acquiring meteorological data, topographic data and remote sensing data of the area to be predicted; Inputting the meteorological data, the terrain data and the remote sensing data into a machine learning model to obtain a prediction result of the machine learning model on the soil composition of the area to be predicted; The soil composition is determined according to the prediction result and the predicted soil characteristic map.

8. The method for determining soil composition of a region to be predicted according to claim 7, characterized in that: Determining the soil composition according to the prediction result and the predicted soil characteristic map comprises: Extracting a first sub-soil component of the area to be predicted from the prediction result, and extracting a second sub-soil component of the area to be predicted from the predicted soil characteristic map; The first sub-soil component and the second sub-soil component are fused to obtain the soil component.

9. A device for determining the soil composition of an area to be predicted, characterized in that: include: a memory configured to store instructions; A processor is configured to call the instructions from the memory and implement the method for determining the soil composition of a to-be-predicted area according to any one of claims 1 to 8 when executing the instructions.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions for causing a machine to execute the method for determining soil composition of a to-be-predicted area according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Soil impurity detection method based on deep learning

    CN111476129A

  • Remote sensing image bare land classification method and device

    CN115527113A

  • Fusion attention-based focus area determination method and device, and storage medium

    CN116402997A

  • Recognition method and device of fill image, electronic equipment and storage medium

    CN116704445A

  • Model training method, system and device based on generative adversarial network and medium

    CN117095216A