Method, device and storage medium for determining soil composition of an area to be predicted
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 quickly and accurately determined. This solves the problems of long time consumption, high cost, and large error in traditional methods, and achieves efficient soil composition identification.
Patent Information
- Application Number
- CN202411665800.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-11-20
AI Technical Summary
Traditional soil composition analysis methods are time-consuming, costly, and prone to errors, making it impossible to accurately obtain the actual soil composition.
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.
It enables rapid and accurate determination of soil composition, reduces human intervention, lowers labor costs, and improves identification speed and accuracy.
Smart Images

Figure CN119600404B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of soil science and technology, and specifically to a method, apparatus and storage medium for determining the soil composition of an area to be predicted. Background Technology
[0002] Soil is one of the Earth's most important natural resources, playing a vital role in agricultural production, ecological environmental protection, and geological research. Traditional soil composition analysis typically relies on laboratory methods such as chemical analysis, physical testing, and spectroscopic analysis. These methods require soil sample collection and cumbersome laboratory procedures and data processing to obtain soil composition results, consuming significant time and human resources and heavily depending on equipment and specialized knowledge. Furthermore, existing soil composition analysis techniques are overly reliant on the experimental environment, leading to significant discrepancies between the obtained analysis results and reality, and failing to accurately determine the actual soil composition. Summary of the Invention
[0003] The purpose of this application is to provide a method, apparatus, and storage medium for determining the soil composition of a region to be predicted, in order to solve the problems of long time consumption, high cost, and large error in soil composition identification in the prior art.
[0004] To achieve the above objectives, the first aspect of this application provides a method for determining the soil composition of a region to be predicted, the method comprising:
[0005] Acquire image data of the region to be predicted;
[0006] Image data is input into the encoder of the image prediction model to obtain downsampled feature maps. The image prediction model also includes an attention mechanism module and a decoder.
[0007] The encoder inputs the downsampled feature maps into the decoder and the 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 and invalid features in the downsampled feature map and inputs the valid and invalid features into the decoder.
[0010] The decoder fuses the valid features, invalid features, and upsampled feature maps to obtain a predicted soil feature map of the region to be predicted.
[0011] The soil composition of the area to be predicted is determined based on the predicted soil characteristic map.
[0012] In this embodiment, the image prediction model is based on a swin-unet grid structure.
[0013] In this embodiment, the encoder and decoder have a symmetrical structure. 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. This includes the multiple first network layers inputting the downsampled first sub-feature map to the corresponding attention mechanism module and the second network layer respectively.
[0014] In this embodiment of the application, the decoder performs upsampling processing on the downsampled feature map to obtain the upsampled feature map, including: multiple second network layers performing upsampling processing on the received first sub-feature map to obtain the upsampled second sub-feature map.
[0015] In this embodiment of the application, the attention mechanism module identifies valid and invalid features in the downsampled feature map and inputs the valid 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 and valid features in the first sub-feature map of the first network layer and inputs the valid 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 this embodiment of the application, the decoder fuses the effective features, invalid features, and upsampled feature maps to obtain a predicted soil feature map of the region to be predicted. This includes: each second network layer in the multi-layer second network layer fuses the second sub-feature map, effective features, and invalid features of the second network layer to obtain a fused third sub-feature map; and the predicted soil feature map is determined based on the third sub-feature maps of all the second network layers.
[0017] In this embodiment of the application, determining the soil composition of the area to be predicted based on the predicted soil feature map includes: acquiring 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 the prediction result of the machine learning model of the soil composition of the area to be predicted; and determining the soil composition based on the prediction result and the predicted soil feature map.
[0018] In this embodiment of the application, determining the soil composition based on the prediction results and the predicted soil feature 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 feature map; and fusing the first sub-soil composition and the second sub-soil composition to obtain the soil composition.
[0019] A second aspect of this application provides an apparatus for determining the soil composition of an area to be predicted, comprising:
[0020] The memory is configured to store instructions;
[0021] The processor is configured to retrieve instructions from memory and, when executing the instructions, to implement the aforementioned method for determining the soil composition of the area to be predicted.
[0022] A third aspect of this application provides a machine-readable storage medium storing instructions for causing a machine to perform the aforementioned method for determining the soil composition of a region to be predicted.
[0023] The above technical solution enables the encoder in the image prediction model to downsample image data to obtain a downsampled feature map. This downsampled feature map is then input into the decoder and attention mechanism module within the image prediction model. The decoder upsamples the downsampled feature map to obtain an upsampled feature map. The attention mechanism module identifies valid and invalid features in the downsampled feature map and inputs them into the decoder. The decoder fuses the valid and invalid features with the upsampled feature map to obtain a predicted soil feature map of the region to be predicted. Based on the predicted soil feature map, the soil composition of the region to be predicted is determined, enabling rapid and accurate identification of the soil composition while reducing manual intervention, lowering labor costs, and improving recognition speed and accuracy.
[0024] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0025] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings:
[0026] Figure 1 This illustration schematically shows a flowchart of a method for determining the soil composition of an area to be predicted according to an embodiment of this application;
[0027] Figure 2 This illustration schematically shows another process diagram of a method for determining the soil composition of an area to be predicted according to an embodiment of this application;
[0028] Figure 3 The schematic diagram illustrates a swin-unet mesh structure according to an embodiment of this application;
[0029] Figure 4The diagram illustrates the internal structure of a computer device according to an embodiment of this application. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0031] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0032] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0033] Figure 1 The illustration schematically shows a flowchart of a method for determining the soil composition of an area to be predicted according to an embodiment of this application. Figure 1 As shown in the figure, this application provides a method for determining the soil composition of an area to be predicted, which may include the following steps.
[0034] Step 101: Obtain image data of the region to be predicted.
[0035] Step 102: Input the image data into the encoder of the image prediction model to obtain the downsampled feature map. The image prediction model also includes an attention mechanism module and a decoder.
[0036] Step 103: The encoder inputs the downsampled feature maps into the decoder and attention mechanism module respectively.
[0037] The processor can acquire image data of the region to be predicted, such as image data collected by a drone or by an image acquisition device like a camera. After obtaining the image data, the processor can input it into the encoder of the image prediction model to downsample the image data and obtain a downsampled feature map. The image prediction model may also include an attention mechanism module and a decoder. In a specific embodiment, the image prediction model can be a model based on a Swin-unet (Transformer-based medical image segmentation model) mesh 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 this embodiment, the encoder and decoder have a symmetrical structure. 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. This includes the multiple first network layers inputting the downsampled first sub-feature map to the corresponding attention mechanism module and the second network layer respectively.
[0039] The encoder and decoder can have a symmetrical structure. The encoder may include multiple first network layers, and the decoder may include a second network layer corresponding to each first network layer. An attention mechanism module connects each first network layer and its corresponding second network layer. The encoder can input downsampled feature maps into the decoder and the attention mechanism module, respectively. Specifically, the multiple first network layers in the encoder can downsample the image data to obtain a first sub-feature map. After obtaining the first sub-feature map, the multiple first network layers in the encoder can input the first sub-feature map into the corresponding attention mechanism module and the second network layer, respectively.
[0040] In this embodiment of the application, the decoder performs upsampling processing on the downsampled feature map to obtain the upsampled feature map, including: multiple second network layers performing upsampling processing on the received first sub-feature map to obtain the upsampled second sub-feature map.
[0041] The decoder can upsample the downsampled feature map to obtain an upsampled feature map. Specifically, the multi-layer second network in the decoder can receive the corresponding first sub-feature map and upsample the received first sub-feature map to obtain the upsampled second sub-feature map.
[0042] In this embodiment of the application, the attention mechanism module identifies valid and invalid features in the downsampled feature map and inputs the valid 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 and valid features in the first sub-feature map of the first network layer and inputs the valid 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 and invalid features in the downsampled feature map and input the valid and invalid features into 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 and valid features in the first sub-feature map of the first network layer and input the valid 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.
[0044] In this embodiment of the application, the decoder fuses the effective features, invalid features, and upsampled feature maps to obtain a predicted soil feature map of the region to be predicted. This includes: each second network layer in the multi-layer second network layer fuses the second sub-feature map, effective features, and invalid features of the second network layer to obtain a fused third sub-feature map; and the predicted soil feature map is determined based on the third sub-feature maps of all the second network layers.
[0045] The decoder can fuse valid features, invalid features, and upsampled feature maps to obtain a predicted soil feature map of the region to be predicted. Specifically, each second network layer in the decoder fuses its second sub-feature map, valid features, and invalid features 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, thereby enriching 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 on the downsampled feature map to obtain the upsampled feature map.
[0047] Step 105: The attention mechanism module identifies the valid and invalid features in the downsampled feature map and inputs the valid and invalid features into the decoder.
[0048] Step 106: 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.
[0049] Step 107: Determine the soil composition of the area to be predicted based on the predicted soil feature map.
[0050] The decoder receives the downsampled feature map from the encoder and upsamples it to obtain an upsampled feature map. The attention mechanism module receives the downsampled feature map from the encoder, identifies valid and invalid features in the downsampled feature map, and inputs these features to the decoder. In an optional embodiment, the attention mechanism module calculates the importance score of each feature in the downsampled feature map, identifies features with an importance score greater than or equal to a preset value as valid features, and identifies features with an importance score less than the preset value as invalid features. The preset value can be determined based on the soil of the area to be predicted. The decoder receives the valid and invalid features from the attention mechanism module and fuses the valid and invalid features with the upsampled feature map to obtain a 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 based on the predicted soil feature map. 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 this embodiment of the application, determining the soil composition of the area to be predicted based on the predicted soil feature map includes: acquiring 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 the prediction result of the machine learning model of the soil composition of the area to be predicted; and determining the soil composition based on the prediction result and the predicted soil feature map.
[0052] The processor can determine the soil composition of the area to be predicted based on the predicted soil feature map. Specifically, the processor can acquire meteorological data, topographic data, and remote sensing data for the area to be predicted. The meteorological data can be 10-meter resolution meteorological data, obtained through measurements taken at a small weather station installed in the area, and may include temperature, humidity, and rainfall. The topographic data can be provided by SRTM (Shuttle Radar Topography Mission) and may include elevation, slope, aspect, profile curvature, topographic curvature, soil thickness, topographic relief, surface roughness, and topographic moisture index. The remote sensing data can be based on visible light data, near-infrared data, and thermal infrared data from the Sentinel-2 satellite, calculating the Normalized Difference Vegetation Index (NDVI) for the area to be predicted to assess vegetation growth, and soil moisture and soil surface temperature calculated from the thermal infrared data. After obtaining the meteorological, topographic, and remote sensing data for the area to be predicted, the processor can input these data into a machine learning model to obtain the model's prediction results for the soil composition of the area. After obtaining the prediction results of the machine learning model for the soil composition of the area to be predicted, the processor can determine the soil composition based on the prediction results and the predicted soil feature map. In an optional embodiment, the processor can perform a weighted average of the soil composition prediction results obtained from the machine learning model and the soil composition obtained from the predicted soil feature map to obtain the final soil composition of the area to be predicted.
[0053] In this embodiment of the application, determining the soil composition based on the prediction results and the predicted soil feature 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 feature map; and fusing the first sub-soil composition and the second sub-soil composition to obtain the soil composition.
[0054] The processor can determine soil composition based on the prediction results and the predicted soil feature map. Specifically, the processor can extract a first sub-soil component of the area to be predicted from the prediction results and a second sub-soil component of the area to be predicted from the predicted soil feature map. After obtaining the first and second sub-soil components, the processor can fuse the first and second sub-soil components to obtain the soil composition of the area to be predicted.
[0055] In one embodiment, such as Figure 2As shown, the area to be predicted can be a plot of land on a farm. The processor can acquire meteorological station data for the plot from various weather stations located on the farm, including temperature, precipitation, and humidity; acquire topographic data for the plot, including elevation, slope, aspect, profile curvature, topographic curvature, soil thickness, topographic relief, surface roughness, and topographic humidity index; acquire satellite remote sensing data for the plot, including NDVI index, surface temperature, and soil moisture; and acquire drone data, i.e., 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 using a 30-meter resolution based on the farm's map data. Each grid can be a 30m x 30m square area. Then, the processor can randomly sample from the grids within each plot, with the number of sampling points per plot being one-fifth of the grid data. If the calculated number of sampling points for a plot is less than 1, the processor can perform one sampling for that plot, ensuring at least one sampling point per plot. The processor can acquire soil sampling data from each sampling point, including soil pH, organic matter, phosphorus, potassium, calcium, and magnesium, etc., as label values. This data is then combined with meteorological station data, topographic data, and satellite remote sensing data to train the machine learning algorithm, and with UAV data to train the Transformer image prediction algorithm. Finally, the trained machine learning algorithm and the Transformer image prediction algorithm are jointly used for prediction to determine the soil composition of the plot.
[0057] Specifically, the training of machine learning algorithms can use the longitude, latitude, humidity, temperature, rainfall, elevation, slope, aspect, profile curvature, topographic curvature, soil thickness, topographic relief, surface roughness, topographic humidity index, NDVI index, soil moisture, and surface temperature of sampling points as training features, with target values of soil pH, organic matter, phosphorus, potassium, and magnesium. The regression loss function can be the MSE function, i.e. Among them, L mse y is the loss value during machine learning algorithm training, m is the number of training samples during machine learning algorithm training, and y is the loss value during machine learning algorithm training. i y represents the actual soil composition of the i-th training sample during machine learning algorithm training. Δ i This is the predicted soil composition of the i-th training sample during the training of the machine learning algorithm.
[0058] The Transformer image prediction algorithm can employ a win-unet network structure. For example... Figure 3As shown, at the encoder end of the Swin-unet network structure, the input UAV image with a size of 512×512×9 is first processed by PatchPartition to obtain multiple smaller image blocks with a size of 64×64×576. These smaller blocks are then processed by LinearEmbedding and three Swin Transformer blocks 2 (shift window transformation module v2) to generate a feature map with a size of 32×32×256. Next, Patch Merging is used for downsampling, reducing the feature map size to 16×16×512. After further processing by the three Swin Transformer blocks 2, the feature map is further reduced to 8×8×1024. Finally, Patch Merging is used again for downsampling, reducing the feature map size to 4×4×2056. Therefore, the final output feature map of the encoder has a size of 4×4×2056.
[0059] The final output feature map of the encoder will be 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 will be transformed and nonlinearly operated to enhance the expressive power of the features while maintaining the size of the feature map as 4×4×2056.
[0060] At the decoder end of the Swin-unet network structure, the 4×4×2056 feature map is upsampled using Patch Expanding and three SwinTransformer blocks2 to enlarge its size to 8×8×1024. Simultaneously, at the encoder end, symmetrical to these three SwinTransformer blocks2, the downsampled 8×8×1024 feature map uses an Attention Gage (AG) module to identify valid and invalid features. These identified features are then input to the decoder for A (Add) fusion with the upsampled 8×8×1024 feature map to achieve information fusion. The fused 8×8×1024 feature map is then upsampled again using Patch Expanding and the three SwinTransformer blocks2 to obtain a 16×16×512 feature map. Simultaneously, the three Swing Transformer blocks 2 on the encoder side, symmetrical to the three Swing Transformer blocks 2, identify valid and invalid features using an attention mechanism module (AG) on the downsampled 16×16×512 feature map. These identified valid and invalid features are then input to the decoder for A(Add, fusion) processing with the upsampled 16×16×512 feature map to obtain a fused 16×16×512 feature map. This fused 16×16×512 feature map is then further upsampled using Patch Expanding and the three Swing Transformer blocks 2 to obtain a 32×32×256 feature map. Meanwhile, the three Swing Transformer blocks 2 at the encoder end, which are symmetrical to the three Swing Transformer blocks 2, identify effective and invalid features for the downsampled feature map of size 32×32×256 through the Attention Gage module (AG). The identified effective and invalid features are then input to the decoder to perform A (Add, Fusion) processing with the upsampled feature map of size 32×32×256 to obtain a fused feature map of size 32×32×256.Then, the fused feature map of size 32×32×256 undergoes Patch Expanding to enlarge its size to 512×512×256, followed by Linear Projection to obtain the final output feature map of size 512×512×6 from the decoder. Furthermore, in each of the above fusion processes, Patch Expanding is used to restore details in the feature map, thereby improving the fusion accuracy. The loss function of the Transformer image prediction algorithm is L. all =0.6*L c +0.4*L nc , where L all L represents the loss value of the Transformer image prediction algorithm. c For the loss of sampling points, L nc This represents the loss at non-sampling points.
[0061] The above technical solution can quickly and accurately determine the soil composition of the area to be predicted, while reducing human intervention, lowering labor costs, and improving identification speed and accuracy.
[0062] Figure 1 and Figure 2 This is a flowchart illustrating a method for determining the soil composition of an area to be predicted, as shown in one embodiment. It should be understood that, although... Figure 1 and Figure 2 The steps in the flowchart are shown sequentially 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 in which these steps are executed, and they can be performed in other orders. Furthermore, Figure 1 and Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed 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 some of the sub-steps or stages of other steps.
[0063] This application also provides an apparatus for determining the soil composition of a region to be predicted, comprising:
[0064] The memory is configured to store instructions;
[0065] The processor is configured to retrieve instructions from memory and, when executing the instructions, to implement the aforementioned method for determining the soil composition of the area to be predicted.
[0066] This application also provides a machine-readable storage medium storing instructions that cause a machine to perform the above-described method for determining the soil composition of a region to be predicted.
[0067] In one embodiment, a computer device is provided, which 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), and a database (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes 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). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A04. The database stores image data, feature maps, valid data, invalid data, predicted soil feature maps, and soil composition data. The network interface A02 is used for communication with external terminals via a network connection. When executed by the processor A01, the computer program B02 implements a method for determining the soil composition of a region to be predicted.
[0068] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0069] This application provides an apparatus including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: acquiring image data of a region 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 inputting the downsampled feature map into the decoder and the attention mechanism module respectively; the decoder upsampling the downsampled feature map to obtain an upsampled feature map; the attention mechanism module identifying valid and invalid features in the downsampled feature map and inputting the valid and invalid features into the decoder; the decoder fusing the valid features, invalid features, and the upsampled feature map to obtain a predicted soil feature map of the region to be predicted; and determining the soil composition of the region to be predicted based on the predicted soil feature map.
[0070] In one embodiment, the image prediction model is based on a swin-unet grid structure.
[0071] In one embodiment, the encoder and 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 its corresponding second network layer. The encoder inputs the downsampled feature maps to the decoder and the attention mechanism module respectively, including: the multiple first network layers inputting the downsampled first sub-feature maps to the corresponding attention mechanism module and the second network layer respectively.
[0072] In one embodiment, the decoder performs upsampling processing on the downsampled feature map to obtain an upsampled feature map, including: multiple second network layers performing upsampling processing on the received first sub-feature map to obtain an upsampled second sub-feature map.
[0073] In one embodiment, the attention mechanism module identifies valid and invalid features in the downsampled feature map and inputs the valid 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 and valid features in the first sub-feature map of the first network layer and inputs the valid 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 valid features, invalid features, and upsampled feature maps to obtain a predicted soil feature map of the region to be predicted, including: each second network layer in the multi-layer second network layer 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 the second network layers.
[0075] In one embodiment, determining the soil composition of the area to be predicted based on the predicted soil feature map includes: acquiring 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 the prediction result of the machine learning model of the soil composition of the area to be predicted; and determining the soil composition based on the prediction result and the predicted soil feature map.
[0076] In one embodiment, determining soil composition based on prediction results and a predicted soil feature map includes: extracting a first sub-soil component of the area to be predicted from the prediction results and extracting a second sub-soil component of the area to be predicted from the predicted soil feature map; and fusing the first sub-soil component and the second sub-soil component to obtain the soil composition.
[0077] This application also provides a computer program product that, when executed on a data processing device, is adapted to perform a program that initializes a method step for determining the soil composition of a region to be predicted.
[0078] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0079] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0080] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0081] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified 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] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0084] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0085] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0086] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for determining the soil composition of an area to be predicted, characterized in that, The method includes: Acquire image data of the region to be predicted; The image data is input into the encoder of the image prediction model to obtain a downsampled feature map. 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 on the downsampled feature map to obtain an upsampled feature map; The attention mechanism module identifies the valid and invalid features in the downsampled feature map and inputs the valid and invalid features into the decoder. The decoder fuses the effective features, the invalid features, and the upsampled feature map to obtain a predicted soil feature map of the region to be predicted. The soil composition of the area to be predicted is determined based on the predicted soil feature map. Determining the soil composition of the area to be predicted based on the predicted soil feature map includes: Acquire meteorological data, topographic data, and remote sensing data of the area to be predicted; The meteorological data, the topographic data, and the remote sensing data are input into a machine learning model to obtain the prediction results of the machine learning model on the soil composition of the area to be predicted. The soil composition is determined based on the prediction results and the predicted soil feature 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 based on a 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 have a symmetrical structure. 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 connects each first network layer and its corresponding second network layer. The encoder inputs the downsampled feature maps to the decoder and the attention mechanism module, respectively, including: The first sub-feature map after downsampling is input into the corresponding attention mechanism module and the second network layer.
4. The method for determining the soil composition of a region to be predicted according to claim 3, characterized in that, The decoder performs upsampling on the downsampled feature map to obtain the upsampled feature map, which includes: Each of the multi-layer second network layers performs upsampling processing on the received first sub-feature map to obtain the upsampled second sub-feature map.
5. The method for determining the soil composition of a region to be predicted according to claim 4, characterized in that, The attention mechanism module identifies valid and invalid features in the downsampled feature map and inputs the valid and invalid features into 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 the invalid and valid features in the first sub-feature map of the first network layer, and inputs the valid 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.
6. The method for determining the 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 a predicted soil feature map of the region to be predicted, including: Each of the multi-layer second network layers fuses the second sub-feature map, effective features, and invalid features of the second network layer to obtain the fused third sub-feature map. The predicted soil feature map is determined based on the third sub-feature map 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 based on the prediction results and the predicted soil feature map includes: The first sub-soil component of the area to be predicted is extracted from the prediction results, and the second sub-soil component of the area to be predicted is extracted from the predicted soil feature map. The first sub-soil component and the second sub-soil component are combined to obtain the soil component.
8. An apparatus for determining the soil composition of an area to be predicted, characterized in that, include: The memory is configured to store instructions; The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the method for determining the soil composition of a region to be predicted according to any one of claims 1 to 7.
9. A machine-readable storage medium, characterized in that, The machine-readable storage medium contains instructions for causing the machine to perform a method for determining the soil composition of an area to be predicted, according to any one of claims 1 to 7.
Citation Information
Patent Citations
Recognition method and device of fill image, electronic equipment and storage medium
CN116704445A
Deep learning model and road data extraction method thereof
CN118447368A