Method for determining farmland area of remote sensing image based on improved grabcut and semantic segmentation
By improving the GrabCut algorithm and semantic segmentation model, combining NDVI and LBP texture features, and optimizing U-Net++, a collaborative application mechanism for satellite and UAV imagery was established. This solved the problem of large-area coverage and accurate extraction of small areas in farmland segmentation of remote sensing images, and achieved efficient and accurate farmland area measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-18
- Publication Date
- 2026-04-14
AI Technical Summary
Existing remote sensing imagery farmland segmentation technologies suffer from the problem of balancing large-area coverage with precise extraction of small areas. The GrabCut algorithm relies on manual annotation of seed points, resulting in low efficiency and insufficient segmentation accuracy. Semantic segmentation models are computationally intensive and have poor real-time performance, failing to meet the accuracy and efficiency requirements of agricultural resource surveys and land registration.
An improved GrabCut algorithm is used to generate seed points by combining NDVI index and LBP texture features, and multi-feature fusion is introduced into the energy function. The semantic segmentation model is optimized using U-Net++, which introduces attention gating and depthwise separable convolution, and combines a collaborative dual judgment mechanism of satellite and UAV imagery to consider the impact of terrain slope.
It achieves high-precision and high-speed farmland area measurement, improves segmentation accuracy and calculation efficiency, meets the needs of accurate extraction of large-area farmland and efficient calculation of small-area farmland, and the area calculation error is less than 10%.
Smart Images

Figure CN121527167B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of farmland area measurement technology, specifically to a method for measuring farmland area from remote sensing images based on improved GrabCut and semantic segmentation. Background Technology
[0002] In the practical application of farmland segmentation and area calculation technology in remote sensing imagery, existing solutions have multiple shortcomings, making it difficult to simultaneously meet the needs of large-area coverage and precise extraction of small areas: For farmland segmentation in satellite remote sensing imagery, the currently mainstream GrabCut algorithm relies excessively on manual annotation of "foreground / background" seed points, which is not only inefficient but also fails to effectively distinguish spectral and texturally similar areas in remote sensing images by relying solely on color features, resulting in segmentation accuracy generally below 80%, making it difficult to adapt to the efficient and precise extraction of large areas of farmland; For high-resolution sub-meter-level satellites, although they can capture details such as field ridges and irrigation ditches, the data volume of a single scene reaches GB levels. When the traditional GrabCut algorithm processes such images, the computation time increases by 8-10 times compared to 10m resolution images, and it is prone to misjudging farmland boundaries due to "overemphasis on local noise," causing the segmentation IoU to drop from 0.82 to below 0.65.
[0003] In UAV remote sensing image analysis, semantic segmentation technology provides a new approach to enhance detail perception for crop identification, resource monitoring, and land parcel extraction. However, existing semantic segmentation models have significant limitations. On the one hand, due to redundant model parameters, the computational load for processing high-resolution images is large and the real-time performance is poor, making it difficult to meet the needs of rapid on-site analysis. On the other hand, training data is often limited to a single crop or region, resulting in a recall rate of less than 75% for segmenting small plots of farmland in mountainous areas and mixed areas of crop seedlings and bare land, making it easy to miss small areas of farmland. In addition, existing technologies have not established a collaborative application mechanism between satellites and UAVs. Either relying solely on satellite data leads to missed detections of small areas of farmland, or using only UAV data results in low efficiency for processing large areas. Furthermore, the impact of the slope of the mountainous terrain in remote sensing images on the actual area is not fully considered during the area calculation process, ultimately leading to an error of more than 10% in the calculation of farmland area, which cannot meet the dual requirements of accuracy and efficiency in scenarios such as agricultural resource surveys and land registration. Summary of the Invention
[0004] The purpose of this invention is to provide a method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation, in order to solve the problems mentioned in the background art.
[0005] To address the aforementioned technical problems, this invention provides the following technical solution: a method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation, comprising the following operational steps:
[0006] Step 1: Acquire satellite remote sensing images of the target area, perform radiometric calibration, atmospheric correction and geometric correction on the satellite remote sensing images in sequence, and use the improved GrabCut algorithm to extract farmland areas to obtain satellite farmland segmentation masks.
[0007] Preferably, the improved GrabCut algorithm includes: automatically generating foreground and background seed points based on the NDVI index; introducing LBP texture features into the energy function; the energy function is... ,in, Represents total energy. Represents the weight coefficient of the data item. Represents the weighting coefficient of the smoothing term; Represents the energy of the data item. Represents the energy of the smooth term. Combining the RGB color histogram and the LBP texture histogram, Maintain consistency between adjacent pixels.
[0008] Preferably, for The enhancement process includes: first, calculating the RGB channels of the image to obtain the color features of each pixel; then, calculating the LBP feature value of each pixel in the converted grayscale image; constructing histogram models of RGB color histograms and LBP texture histograms for the foreground and background respectively; and generating new histograms based on the weighted sum of color and texture costs. item.
[0009] Preferably, the improved GrabCut algorithm is used to extract farmland areas, including:
[0010] Step 11: Input a multispectral image containing red and near-infrared bands;
[0011] Step 12: Calculate the NDVI of the entire image and generate a Trimap based on the set threshold to identify the foreground, background, and unknown regions;
[0012] Step 13: Based on the current determined foreground / background regions, construct RGB color models and LBP texture models for the foreground and background respectively. Calculate the cost of each pixel in the unknown region belonging to the foreground or background. Then construct a graph network and use a graph cut algorithm to minimize it to obtain new segmentation results. Continuously update the model and segmentation until convergence.
[0013] Step 14: The final output is a binary segmentation image containing the foreground and background.
[0014] Step 2: Acquire UAV remote sensing images of farmland in the target area. After image enhancement of the UAV farmland remote sensing images, use an optimized semantic segmentation model to extract the farmland area and obtain the UAV farmland segmentation mask.
[0015] Preferably, the optimized semantic segmentation model is based on U-Net++, with attention gating introduced on skip connections, the backbone network replaced by depthwise separable convolutions of MobileNetV3, and ECA-Net added in the decoding stage. At the same time, the loss function is changed to Dice+FocalLoss, where Dice+FocalLoss is a combination of the Dice loss function and the Focal loss function; DiceLoss ensures that the model prioritizes learning the "overall outline of the farmland area".
[0016] Preferably, the operation process of the optimized semantic segmentation model includes:
[0017] Step 21: Input an RGB farmland image and perform preprocessing operations, including size optimization and aspect ratio preservation;
[0018] Step 22: Define the backbone network coding section;
[0019] Step 23: Decoding part through attention gating and upsampling fusion;
[0020] Step 24: Use 1×1 convolution and Sigmoid activation function to output a probability map, perform image preprocessing, and then output the UAV farmland segmentation mask image.
[0021] Step 3: Obtain DEM data of the target area, and calculate the dynamic threshold by combining the spatial resolution of satellite imagery and the resolution of UAV imagery.
[0022] Preferably, the specific steps include: acquiring DEM data and satellite imagery of the target area; combining the spatial resolution of the satellite imagery... and drone image resolution Calculate dynamic threshold , ,in The topographic coefficient is used; a grading scheme is formulated based on the water requirements of crops; for water-intensive crop areas, UAV imagery is used for small-scale calculations; for non-water-intensive crop areas, satellite remote sensing is used for large-scale estimations.
[0023] Step 4: Based on the satellite farmland segmentation mask, the area calculation method is determined and the final area is calculated through a collaborative dual-judgment application mechanism of satellite and UAV.
[0024] Preferably, the collaborative dual-judgment application mechanism is as follows: judgment is made based on the crop type of the target area; preliminary area of each farmland plot is calculated using connected component analysis. ;when Then, through step 1, based on the satellite farmland segmentation mask and Calculate the final area ;when Then, through step 2, based on the drone farmland segmentation mask and Calculate the final area , ;in The number of farmland pixels in the satellite farmland segmentation mask. This represents the number of farmland pixels in the drone-generated farmland segmentation mask. The average slope of the farmland area is extracted from the DEM.
[0025] Compared with existing technologies, the beneficial effects achieved by this invention are as follows: This invention addresses the low efficiency of the existing GrabCut algorithm in remote sensing imagery, which requires manual annotation of a large number of "foreground (farmland) / background (buildings, water bodies)" seed points and relies solely on "color features" for segmentation, failing to meet the demand for accurate extraction of large areas of farmland. It utilizes an improved GrabCut algorithm to extract farmland areas, combining a seed point generation mechanism with multi-feature fusion using energy functions to achieve high-precision segmentation masks for satellite farmland. Furthermore, it addresses the problems of existing semantic segmentation models (such as the original U-Net) in processing high-resolution UAV imagery (0.03-0.04m) due to "high computational load and poor real-time performance," and the issue that training data only covers a single crop / region. An improved U-Net++ model is proposed, and a multi-crop farmland scene dataset is established. In addition, a collaborative dual-judgment application mechanism is established between satellite (large-area coverage) and UAV (small-area fine extraction), improving the efficiency of large-area processing while enabling area calculation for small-area farmland. It also fully considers the impact of terrain slope in mountainous areas of remote sensing imagery on the actual area. Finally, the area of farmland in each remote sensing image is obtained by using the obtained spatial resolution and the GSD of the UAV remote sensing image. The results obtained by this method are no less accurate than those of traditional calculation methods, while improving computational efficiency and having greater versatility. Attached Figure Description
[0026] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0027] Figure 1 This is a flowchart of a method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation, provided in an embodiment of the present invention.
[0028] Figure 2 This is a schematic diagram illustrating the principle of the improved U-Net++ provided in this embodiment of the invention.
[0029] Figure 3 This is a flowchart of an example of farmland area calculation using a multi-remote sensing collaborative dual-judgment application mechanism provided in this embodiment of the invention.
[0030] Figure 4 This is a qualitative experimental comparison diagram of various semantic segmentation algorithms provided in the embodiments of the present invention.
[0031] Figure 5 This is a segmentation effect diagram of the improved GrabCut algorithm provided in the embodiment of the present invention.
[0032] Figure 6 This is a comparison chart of the calculated area and the actual value provided in the embodiments of the present invention.
[0033] Figure 7 This is a schematic diagram of the ablation experiment results of the method of the present invention, the traditional GrabCut+U-Net, and the present invention (feature-free fusion) provided in the embodiments of the present invention. Detailed Implementation
[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] Combination Figures 1-7 As shown, the present invention provides a technical solution: a method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation, comprising the following operational steps:
[0036] Step 1: Acquire satellite remote sensing images of the target area, perform radiometric calibration, atmospheric correction and geometric correction on the satellite remote sensing images in sequence, and use the improved GrabCut algorithm to extract farmland areas to obtain satellite farmland segmentation masks;
[0037] In this embodiment, the improved GrabCut algorithm includes: automatically generating foreground seed points (NDVI>0.3) and background seed points (NDVI<0.1) based on the NDVI index, and introducing LBP texture features into the energy function, wherein the energy function is... ,in, Representing the total energy, it is the output of the entire energy function and is used to evaluate the quality of the segmentation state of the current pixel set. Represents the weight coefficient of the data item; Represents the weighting coefficient of the smoothing term; The energy of the data item represents the energy component that measures the "matching degree between pixel features and foreground / background models"; The energy representing the smoothing term is an energy component that measures the consistency of "adjacent pixel segmentation categories". Combining the RGB color histogram and the LBP texture histogram, To maintain consistency between adjacent pixels, the improved GrabCut algorithm in this invention iterates 3-5 times. The value ranges from 0.5 to 1.0. The value ranges from 0.5 to 1.0.
[0038] For example, in this embodiment, the satellite remote sensing image is Sentinel-2 or Landsat-8 image with a spatial resolution of 10-30m, and the input image must be a multispectral image, containing at least the red and near-infrared bands. The NDVI value is calculated for each pixel. Trimap: A "three-valued label map" used to assist image segmentation is used to generate seed points to determine the foreground (F in Trimap): all pixels with NDVI > 0.3. This threshold is empirically considered likely to be lush vegetation (foreground). Seed points to determine the background are generated (B in Trimap): all pixels with NDVI < 0.1. This threshold is empirically considered likely to be water bodies, bare soil, buildings, etc. (background). Pixels with remaining NDVI values between [0.1, 0.3] and areas that may be misclassified are labeled as "possible foreground" (U in Trimap).
[0039] For example, LBP texture features are introduced into the energy function. LBP (Local Binary Pattern) is a powerful texture descriptor that generates a binary code by comparing the gray values of a pixel with those of its neighboring pixels, thereby describing local texture patterns.
[0040] The enhancement process for E_data in this embodiment is as follows:
[0041] 1. Feature extraction: First, calculate the color features (original RGB vectors) of each pixel by analyzing the RGB channels of the image. Then, calculate the LBP feature value (usually an integer representing its local texture mode) of each pixel by analyzing the image (usually converted to grayscale).
[0042] 2. Constructing Dual Feature Histograms: The algorithm constructs two histogram models for the foreground and background respectively: one is an RGB color histogram (or still uses GMM, but with increased feature space dimensions). The other is an LBP texture histogram.
[0043] 3. New The term is a weighted sum of color cost and texture cost for a pixel. Its assigned label The cost is:
[0044]
[0045] in: This represents the probability that the RGB color value of this pixel belongs to the foreground / background color model. The probability that the LBP texture value of this pixel belongs to the foreground / background texture model. and It is a weight used to balance the importance of color and texture.
[0046] In energy function middle, Used to control the importance of data items. Increase This will make the model more confident in the probability predictions from the color and texture models. Used to control the importance of smoothing items. Increase This encourages smoother segmentation results and reduces fragmented segments. These two parameters are typically set through cross-validation or empirical values to balance segmentation accuracy and boundary smoothness.
[0047] For example, the improved algorithm flow of this invention is as follows:
[0048] Step 11: Input a multispectral image containing red and near-infrared bands.
[0049] Step 12: Automated Initialization: Calculate the NDVI of the entire image and apply it according to the set threshold. Generate a defined foreground Determine the background and unknown areas Trimap.
[0050] Step 13: Perform iterative optimization: Based on the current F / B region, construct the foreground and background respectively: RGB color model (e.g., GMM); LBP texture model (e.g., histogram), and calculate the cost for each pixel in the unknown region (U) to belong to either the foreground or background. This cost is a weighted sum of color and texture probabilities. The graph network is then reconstructed, with node weights determined by... The edge weight is determined by The decision is made (possibly based on color and texture). Finally, a graph cut algorithm is used to minimize the result, yielding a new segmentation. The model and segmentation are continuously updated until convergence.
[0051] Step 14: Output the final binary segmentation image containing the foreground and background.
[0052] In this invention, a modified GrabCut algorithm is used to extract farmland areas, resulting in a satellite farmland segmentation mask. For farmland extraction and dataset construction from UAV remote sensing images, the datasets used are all high-resolution UAV images manually captured by researchers in real farmland, depicting various crop scenarios. By improving U-Net++, attention gating (AttentionGate, AG) is introduced on skip connections, the backbone network is replaced with depthwise separable convolutions from MobileNetV3, and ECA-Net (EfficientChannelAttention) is added in the decoder stage. Simultaneously, the loss function is changed to Dice+FocalLoss. In our task, the modified U-Net++ is used for extracting complete farmland areas from UAV images. Finally, a dynamic threshold is calculated using the DEM data of the target area, and a collaborative dual-judgment mechanism based on multiple remote sensing sensors is used to select the remote sensing image mask for calculation, combined with the average slope to obtain the final farmland area.
[0053] Step 2: Acquire UAV remote sensing images of farmland in the target area. After image enhancement of the UAV remote sensing images, use an optimized semantic segmentation model to extract the farmland area and obtain the UAV farmland segmentation mask.
[0054] In this embodiment, the GSD of the UAV remote sensing imagery is 0.03-0.04m, and the model training set includes labeled images of three types of terrain: plains, mountains, and hills. Unlike the publicly available datasets used in previous studies, the dataset used in this study consists of high-resolution UAV images manually captured by researchers in real farmland, depicting various farmland crop scenarios.
[0055] For example, the optimized model is based on U-Net++, introducing attention gating (AG) on skip connections, replacing the backbone network with depthwise separable convolutions from MobileNetV3, and adding ECA-Net (EfficientChannelAttention) in the decoding stage. Simultaneously, the loss function is changed to Dice+FocalLoss, where Dice+FocalLoss is a combination of the Dice and Focal loss functions. DiceLoss ensures the model prioritizes learning the overall outline of the farmland area, reducing missed detections of small farmland areas, while FocalLoss guides the model to focus on difficult-to-segment details such as farmland edges and complex mixed areas, improving segmentation precision. The optimized model is attached. Figure 2 As shown;
[0056] For example, the optimized semantic segmentation model proposed in this invention includes the following process for extracting farmland areas:
[0057] Step 21: Input an RGB farmland image and perform preprocessing operations including size optimization while maintaining aspect ratio; in this invention, a 3000×4000 pixel RGB farmland image is input, and the size is optimized and scaled to 512×512×3 while maintaining aspect ratio.
[0058] Step 22: Define the backbone network encoding part (Encoder).
[0059] (1) Stem layer: Through 3×3 convolution, stride=2, followed by BN and ReLU activation, preliminary feature extraction is performed on the input farmland image, while reducing the spatial size. The output tensor is: [1×256×256×16].
[0060] (2) E1 Depthwise Separable Convolutional Block (DWConvBlock): It adopts a combination of 3×3 depthwise convolution and stride=2+1×1 pointwise convolution (PointwiseConv), outputting tensor: [256×256×16], with depthwise separable transformation, achieving efficient feature extraction and reducing the number of parameters.
[0061] (3) E2 depthwise separable convolutional block (DWConvBlock): 3×3 depthwise convolution, stride=2+1×1 pointwise convolution (PointwiseConv); output tensor: [128×128×24], downsampling; downsampling is performed on the basis of the previous layer to extract higher-level feature information.
[0062] (4) E3 Depthwise Separable Convolutional Block (DWConvBlock): 3×3 depthwise convolution, stride=2+1×1 pointwise convolution (PointwiseConv); output tensor: [64×64×40], downsampling; that is, continue to extract mid-to-high-level semantic features through depthwise separable convolution and further reduce spatial resolution.
[0063] (5) E4 Depthwise Separable Convolutional Block (DWConvBlock): 3×3 depthwise convolution, stride=2+1×1 pointwise convolution (PointwiseConv); output tensor: [32×32×80], downsampling. That is, further downsampling and extraction of deeper semantic information.
[0064] (6) Bottleneck layer: Expansion (1×1 convolution to expand channels); depthwise convolution (DWConv); Squeeze-and-Excitation (SE) attention module; pointwise 1×1 convolution dimensionality reduction; output tensor: [16×16×160], deepest feature; adopts a structure that combines channel expansion, depthwise convolution and SE attention mechanism to enhance the feature expression ability between channels, and finally compresses the channels through 1×1 convolution to obtain the deepest semantic features.
[0065] Step 23: The decoding part (Decoder) is fused with the attention gate and upsampling, specifically including:
[0066] (1) Up-sample layer: Bilinear upsampling and 3×3 convolution are combined and BN and ReLU activation are applied. The output tensor is [32×32×80]. Upsampling is used to gradually restore the spatial resolution.
[0067] (2) D4 upsampling + convolution + ECA attention: The E4 features of the encoder are filtered by AttentionGate (AG4) to suppress irrelevant background information; the upsampled features are concatenated with the filtered E4 features and then fused by 3×3 convolution, BN and ReLU; and then connected to the ECA-Net channel attention module to enhance the expression of key information.
[0068] (3) D3 upsampling + convolution + ECA attention: The E3 features of the encoder are weighted by AttentionGate (AG3) to highlight the target region; the upsampled features and the weighted E3 features are concatenated and then fused by 3×3 convolution, BN and ReLU; then ECA-Net is connected to strengthen the channel dependency relationship and output tensor: [128×128×32].
[0069] (4) D2 upsampling + convolution + ECA attention: AttentionGate (AG2) is used to selectively enhance the encoder E2 features; after the upsampled features are concatenated with the enhanced E2 features, they are fused by 3×3 convolution, BN and ReLU; then ECA-Net is introduced to optimize the channel attention distribution, and the output tensor is [256×256×16].
[0070] (5) D1 upsampling + convolution + ECA attention: AttentionGate (AG1) is used to selectively introduce shallow features of encoder E1; after the upsampled features are concatenated with the filtered E1 features, they are fused by 3×3 convolution, BN and ReLU; finally, ECA-Net is connected to further strengthen the feature association between channels, and the output tensor is [512×512×16].
[0071] Step 24: Use 1×1 convolution and Sigmoid activation function to output a probability map, perform image preprocessing, and then output a 3000×4000 pixel drone farmland segmentation mask image.
[0072] Step 3: Obtain DEM data of the target area, and calculate the dynamic threshold by combining the spatial resolution of satellite imagery and the resolution of UAV imagery.
[0073] In this embodiment, a dual judgment mechanism based on crop type and area scale is used to achieve optimal resource allocation. First, DEM data and satellite imagery of the target area are acquired, and the spatial resolution of the satellite imagery is combined with the data. and drone image resolution Calculate dynamic threshold ,in Topographic coefficient (plains) mountainous areas Then, a tiered scheme was developed based on the water requirements of crops: for water-intensive crop areas that are sensitive to water, UAV imagery was used for small-scale, high-precision calculations; while for non-water-intensive crop areas that are widely distributed and have relatively relaxed water requirements, satellite remote sensing was mainly used to achieve large-scale, efficient estimations.
[0074] Step 4: Based on the satellite farmland segmentation mask, the area calculation method is determined and the final area is calculated through a collaborative dual judgment application mechanism of satellite (large area coverage) and UAV (small area fine extraction).
[0075] In this embodiment, the collaborative application mechanism of satellite and drone is as follows: First, the crop type of the target area is determined, and then the preliminary area of each farmland plot is calculated through connected component analysis. ,like Then, through step 1, based on the satellite farmland segmentation mask and Calculate the final area ;like Then, through step 2, based on the drone farmland segmentation mask and Calculate the final area ;in The number of farmland pixels in the satellite farmland segmentation mask. This represents the number of farmland pixels in the drone-generated farmland segmentation mask. The average slope of the farmland area is extracted from the DEM.
[0076] In this embodiment, the process is as follows: Figure 3 As shown, qualitative experiments of various semantic segmentation algorithms are as follows: Figure 4As shown, the first column is the original image, the second column is the label image, the third column is the segmentation result of the method of this invention, the fourth column is the PSP-Net segmentation result, the fifth column is the U-Net segmentation result, and the sixth column is the FCN segmentation result. The improved GrabCut algorithm is used to extract farmland areas, and the resulting satellite farmland segmentation mask image is shown below. Figure 5 As shown.
[0077] like Figure 6 The image shows a comparison between the method used in this invention and the actual area value. This invention acquired 24 farmland images with spatial resolution, DEM data, and average slope using Landsat-8 and a drone. The area calculated using this invention is compared with the actual value.
[0078] like Figure 7 The results shown are ablation experiments using the method of this invention, the traditional GrabCut+U-Net, and the method of this invention (feature-free fusion).
[0079] In summary, the improved GrabCut algorithm was used to extract farmland areas and obtain satellite farmland segmentation masks. Regarding farmland extraction and dataset construction from UAV remote sensing images, the datasets used in this study were all high-resolution UAV images manually captured by researchers in real farmland, covering various crop scenarios. By improving U-Net++, attention gating (AttentionGate, AG) was introduced into the skip connections, the backbone network was replaced with depthwise separable convolutions from MobileNetV3, and ECA-Net (EfficientChannelAttention) was added in the decoder stage. Simultaneously, the loss function was changed to Dice+FocalLoss. In this invention, the improved U-Net++ was used for extracting complete farmland areas from UAV images. Finally, using the DEM data of the target area, a dynamic threshold was calculated, and based on a multi-remote sensing collaborative dual-judgment application mechanism, a remote sensing image mask was selected for calculation, combined with the average slope to obtain the final farmland area. The improved U-Net++ model achieves 96.7% mIoU while maintaining an inference speed of 10.3 FPS (2060), meeting the lightweight requirement while maintaining high accuracy, and demonstrating good segmentation performance for various farmland scenarios. The results obtained using this method are no less accurate than traditional computational methods, while improving computational efficiency and exhibiting greater versatility.
[0080] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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.
[0081] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation, characterized by: The following steps are included: Step 1: Acquire satellite remote sensing images of the target area, perform radiometric calibration, atmospheric correction and geometric correction on the satellite remote sensing images in sequence, and use the improved GrabCut algorithm to extract farmland areas to obtain satellite farmland segmentation masks; The improved GrabCut algorithm includes: automatically generating foreground and background seed points based on the NDVI index; introducing LBP texture features into the energy function; the energy function is... ,in, Represents total energy. Represents the weight coefficient of the data item. Represents the weighting coefficient of the smoothing term; Represents the energy of the data item. Represents the energy of the smooth term. Combining the RGB color histogram and the LBP texture histogram, Maintain consistency between adjacent pixels; Step 2: Acquire UAV remote sensing images of farmland in the target area. After image enhancement of the UAV farmland remote sensing images, use an optimized semantic segmentation model to extract the farmland area and obtain the UAV farmland segmentation mask. The optimized semantic segmentation model is based on U-Net++, introducing attention gating on skip connections, replacing the backbone network with depthwise separable convolutions from MobileNetV3, and adding ECA-Net in the decoding stage. Simultaneously, the loss function is changed to Dice+FocalLoss, where Dice+FocalLoss is a combination of the Dice and Focal loss functions; DiceLoss ensures that the model prioritizes learning the "overall contour of the farmland area." Step 3: Obtain DEM data of the target area, and calculate the dynamic threshold by combining the spatial resolution of satellite imagery and the resolution of UAV imagery; Acquire DEM data and satellite imagery of the target area; combine satellite imagery spatial resolution and drone image resolution Calculate dynamic threshold A grading scheme was developed based on the water requirements of crops; for water-intensive crop areas, small-scale calculations were performed using UAV imagery; for non-water-intensive crop areas, large-scale estimations were performed using satellite remote sensing. Step 4: Based on the satellite farmland segmentation mask, the area calculation method is determined and the final area is calculated through a collaborative dual-judgment application mechanism of satellite and UAV; The collaborative dual-judgment application mechanism is as follows: judgment is made based on the crop type of the target area; preliminary area of each farmland plot is calculated using connected component analysis. ;when Then, through step 1, based on the satellite farmland segmentation mask and Calculate the final area; when Then, through step 2, based on the drone farmland segmentation mask and Calculate the final area.
2. The method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation according to claim 1, characterized in that: right Enhancement is performed, and the enhancement process includes: First, the RGB channels of the image are calculated to obtain the color features of each pixel; Then, the LBP feature value of each pixel is calculated by converting the image to grayscale. Construct histogram models for the foreground and background using RGB color histograms and LBP texture histograms respectively; Generate a new [product / service] based on a weighted sum of color and texture costs. item.
3. The method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation according to claim 2, characterized in that: In step S1, the improved GrabCut algorithm is used to extract farmland areas, including: Step 11: Input a multispectral image containing red and near-infrared bands; Step 12: Calculate the NDVI of the entire image and generate a Trimap based on the set threshold to identify the foreground, background, and unknown regions; Step 13: Based on the current determined foreground / background regions, construct RGB color models and LBP texture models for the foreground and background respectively. Calculate the cost of each pixel in the unknown region belonging to the foreground or background. Then construct a graph network and use a graph cut algorithm to minimize it to obtain new segmentation results. Continuously update the model and segmentation until convergence. Step 14: The final output is a binary segmentation image containing the foreground and background.
4. The method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation according to claim 3, characterized in that: The process of optimizing the semantic segmentation model includes: Step 21: Input an RGB farmland image and perform preprocessing operations, including size optimization and aspect ratio preservation; Step 22: Define the backbone network coding section; Step 23: Decoding part through attention gating and upsampling fusion; Step 24: Use 1×1 convolution and Sigmoid activation function to output a probability map, perform image preprocessing, and then output the UAV farmland segmentation mask image.
5. The method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation according to claim 4, characterized in that: Step 22 defines the backbone network coding portion, which includes: Stem layer: Through 3×3 convolution, followed by BN and ReLU activation, it performs preliminary feature extraction on the input farmland image, while reducing the spatial size and outputting a tensor; E1 depthwise separable convolutional block: uses a combination of 3×3 depthwise convolution and pointwise convolution to output tensors; E2 depthwise separable convolutional block: It uses 3×3 depthwise convolution and point convolution to output tensors, and performs downsampling on the basis of the previous layer to extract higher-level feature information; E3 depthwise separable convolutional block: Employs 3×3 depthwise convolution and pointwise convolution to output tensors, which are then used to extract mid-to-high-level semantic features through depthwise separable convolution, further reducing spatial resolution; E4 depthwise separable convolutional block: Employs 3×3 depthwise convolution and pointwise convolution to output tensors, which are further downsampled and extracted to extract deeper semantic information; Bottleneck layer: It adopts a structure that combines channel expansion, depthwise convolution and SE attention mechanism to enhance the feature expression between channels. Finally, it performs channel compression through 1×1 convolution to obtain the deepest semantic features.
6. The method for determining farmland area from remote sensing images based on improved GrabCut and semantic segmentation according to claim 5, characterized in that: Step 23 includes the following decoding part that uses attention gating and upsampling fusion: Upsampling layer: It adopts a combination of bilinear upsampling and 3×3 convolution, and is connected with BN and ReLU activation. The output tensor is upsampled to restore the spatial resolution. D4 upsampling + convolution + ECA attention: The E4 features of the encoder are filtered by AttentionGate to suppress irrelevant background information; the upsampled features are concatenated with the filtered E4 features, and then fused by 3×3 convolution, BN and ReLU; and then connected to the ECA-Net channel attention module to enhance the expression of key information. D3 Upsampling + Convolution + ECA Attention: The E3 features of the encoder are weighted by AttentionGate to highlight the target region. The upsampled features are concatenated with the weighted E3 features and then fused by 3×3 convolution, BN and ReLU. Subsequently, ECA-Net is connected to strengthen the channel dependency relationship and output tensor. D2 upsampling + convolution + ECA attention: AttentionGate is used to selectively enhance the encoder's E2 features. The upsampled features are concatenated with the enhanced E2 features, and then fused with 3×3 convolution, BN and ReLU. ECA-Net is then introduced to optimize the channel attention distribution and output a tensor. D1 Upsampling + Convolution + ECA Attention: AttentionGate is used to selectively introduce shallow features from encoder E1; the upsampled features are concatenated with the filtered E1 features, and then fused by 3×3 convolution, BN and ReLU; finally, ECA-Net is connected to further enhance the feature correlation between channels and output tensor.