Farmland parcel extraction method based on agricultural parcel instance segmentation framework
By constructing an unsupervised domain adaptation agricultural field instance segmentation framework, adopting a teacher-cross-domain student model and a consistent mutual learning strategy, the domain offset problem in farmland plot extraction from remote sensing images is solved, and high-precision and robust automatic identification of farmland plots is achieved.
Patent Information
- Application Number
- CN202510823396.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-16
AI Technical Summary
现有的遥感图像农田地块提取方法依赖人工解译或半自动分割,费时费力,且难以满足大规模、高精度的需求,尤其在跨区域、跨传感器条件下域偏移问题严重,现有UDA方法效果不佳。
An unsupervised domain-adaptive agricultural field instance segmentation framework based on region-based masked convolutional neural networks is constructed. A teacher-cross-domain student model architecture and a consistent mutual learning strategy are adopted. Through data augmentation and pseudo-label generation, the dependence on target domain labeled data is reduced and the model adaptability is improved.
It effectively solves the domain offset problem of cross-regional and cross-sensor farmland plot extraction, improves the accuracy and robustness of farmland plot extraction, and realizes efficient automatic identification of farmland plots.
Smart Images

Figure CN120656064A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing image processing, and in particular to a method for extracting farmland plots based on an agricultural plot instance segmentation framework. Background Art
[0002] Accurately extracting farmland plots is crucial for agricultural production management, crop yield estimation, and land use surveys. Traditional methods for extracting farmland plots rely primarily on manual visual interpretation or semi-automatic image segmentation techniques, which are time-consuming and labor-intensive, and struggle to meet the demands of large-scale, high-precision extraction.
[0003] In recent years, deep learning technology has made significant progress in remote sensing image interpretation, especially semantic segmentation models based on convolutional neural networks (CNNs), which can automatically learn image features and achieve pixel-level classification. However, these methods typically require large amounts of labeled data for training, which is expensive to obtain.
[0004] Unsupervised Domain Adaptation (UDA) technology can adapt a model to an unlabeled target domain when only labeled data from the source domain is available, thereby reducing reliance on labeled data from the target domain. Existing UDA methods have been applied to semantic segmentation of remote sensing imagery. However, when it comes to extracting farmland plots, existing methods struggle to achieve ideal results due to significant domain shifts in remote sensing images acquired from different regions and sensors, such as spectral differences and variations in plot size and shape.
[0005] Currently, no effective solutions have been proposed for the problems in related technologies. Summary of the Invention
[0006] In view of this, the present invention provides a farmland plot extraction method based on an agricultural field instance segmentation framework to solve the above-mentioned problems.
[0007] In order to solve the above problems, the specific technical solutions adopted by the present invention are as follows: A method for extracting farmland plots based on an agricultural plot instance segmentation framework comprises the following steps: S1. Obtain remote sensing images of farmland plots and obtain a training set by preprocessing the remote sensing images; S2. Region-based masked convolutional neural network to build an unsupervised domain-adaptive agricultural field instance segmentation framework network model; S3. Using the training set, the unsupervised domain-adapted agricultural field instance segmentation framework network model is trained to obtain a trained unsupervised domain-adapted agricultural field instance segmentation framework network model; S4. The trained unsupervised domain-adapted agricultural field instance segmentation framework network model is used to extract farmland plots from the target domain remote sensing image to be identified.
[0008] Preferably, the step of obtaining remote sensing images of farmland plots and preprocessing the remote sensing images to obtain a training set comprises the following steps: S11, collecting source domain remote sensing images and target domain remote sensing images of farmland plots respectively, and obtaining annotation data corresponding to the source domain remote sensing images; S12, performing image preprocessing on the source domain remote sensing image and the target domain remote sensing image of the farmland plot to obtain a preprocessed source domain remote sensing image and a preprocessed target domain remote sensing image, respectively; S13. Use the annotation data corresponding to the source domain remote sensing image to annotate the preprocessed source domain remote sensing image of the farmland plot to obtain a labeled source domain remote sensing image, and use the labeled source domain remote sensing image and the preprocessed target domain remote sensing image as a training set.
[0009] Preferably, the preprocessing includes: image cropping and image normalization; The image cropping is used to perform sliding cropping processing on the source domain remote sensing image and the target domain remote sensing image of the farmland plot based on a preset step size; The image normalization process is used to normalize the image pixel values of the source domain remote sensing image and the target domain remote sensing image of the farmland plot to the predicted pixel interval.
[0010] Preferably, the unsupervised domain-adapted agricultural field instance segmentation framework network model includes a region-based masked convolutional neural network structure and a teacher-cross-domain student model architecture; The teacher-cross-domain student model architecture includes a goal-oriented teacher model and a cross-domain student model; The goal-oriented teacher model is used to generate pseudo labels for the target domain, and the weights of the goal-oriented teacher model are updated by the cross-domain student model through a sliding average method; The cross-domain student model is used to learn under the supervision of source domain labels and target domain pseudo labels, and an image adaptation module and an instance adaptation module are embedded in the cross-domain student model.
[0011] Preferably, the step of training the unsupervised domain-adapted agricultural field instance segmentation framework network model using the training set to obtain the trained unsupervised domain-adapted agricultural field instance segmentation framework network model comprises the following steps: S31, pre-training the goal-oriented teacher model using a data augmentation method based on labeled source domain remote sensing images in a training set; S32. Adopting a consistent mutual learning strategy, using the labeled source domain remote sensing image and the pre-processed target domain remote sensing image, to collaboratively train the goal-oriented teacher model and the cross-domain student model; S33, using an exponential moving average method to update the parameters of the goal-oriented teacher model according to the parameters of the cross-domain student model; S34. Through the back-propagation algorithm, the parameters of the cross-domain student model are updated according to the supervision loss, consistency loss and domain adversarial loss.
[0012] Preferably, the method of pre-training the goal-oriented teacher model using a data augmentation method based on labeled source domain remote sensing images in a training set comprises the following steps: S311, using a data augmentation method to perform image transformation on the labeled source domain remote sensing images in the training set to obtain an enhanced data set; S312. Based on the enhanced dataset, the goal-oriented teacher model is trained in combination with the region-based masked convolutional neural network loss function and pre-configured training parameters.
[0013] Preferably, the step of performing image transformation on the labeled source domain remote sensing images in the training set using a data enhancement method includes: Random cropping is used to crop labeled source domain remote sensing images in the training set according to random proportions; Random flipping is used to flip the labeled source domain remote sensing images in the training set with a preset probability; Color jittering is used to randomly adjust the brightness, contrast, saturation, and hue of labeled source domain remote sensing images in the training set; Gaussian blurring performs Gaussian filtering on labeled source domain remote sensing images in the training set with a preset probability.
[0014] Preferably, the method adopting a consistent mutual learning strategy and using labeled source domain remote sensing images and preprocessed target domain remote sensing images to collaboratively train the goal-oriented teacher model and the cross-domain student model comprises the following steps: S321. Input the labeled source domain remote sensing image into the cross-domain student model and calculate the supervision loss of the cross-domain student model; S322, inputting the target domain remote sensing image into the target-oriented teacher model and the cross-domain student model respectively, and calculating the consistency loss between the prediction results of the cross-domain student model and the soft pseudo labels generated by the target-oriented teacher model; S323. Combine the supervision loss and consistency loss of the cross-domain student model to perform collaborative training of the goal-oriented teacher model and the cross-domain student model.
[0015] Preferably, the expression for updating the parameters of the goal-oriented teacher model according to the parameters of the cross-domain student model by using the exponential moving average method is: ; Where, θ t represents the parameters of the goal-oriented teacher model, θ s represents the parameters of the cross-domain student model, α is the exponential moving average decay coefficient, t Indicates the update iteration round.
[0016] Preferably, the unsupervised domain-adapted agricultural field instance segmentation framework network model completed through training extracts farmland plots from the target domain remote sensing image to be identified, comprising the following steps: S41, inputting the target domain remote sensing image to be identified into the trained unsupervised domain-adapted agricultural field instance segmentation framework network model to obtain a probability map of each pixel belonging to the farmland plot; S41. Based on the predicted threshold, the probability map of the farmland plot is binarized to obtain the final farmland plot extraction result.
[0017] The beneficial effects of the present invention are as follows: by constructing a UDA-FT network model and adopting a teacher-cross-domain student model architecture and a consistent mutual learning strategy, the present invention effectively solves the domain offset problem of cross-regional and cross-sensor farmland plot extraction, thereby improving the accuracy and robustness of farmland plot extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings: Figure 1 is one of the flow charts of a method for extracting farmland plots based on an agricultural plot instance segmentation framework according to an embodiment of the present invention; Figure 2 2. It is a structural diagram of a UDA-FT network model in a farmland plot extraction method based on an agricultural plot instance segmentation framework according to an embodiment of the present invention; Figure 3 is a schematic diagram of a CutMatch data enhancement method in a farmland plot extraction method based on an agricultural field instance segmentation framework according to an embodiment of the present invention; Figure 42 is a schematic diagram of a LeakyMask data enhancement method in a farmland plot extraction method based on an agricultural plot instance segmentation framework according to an embodiment of the present invention; Figure 5 This is the second flowchart of a method for extracting farmland plots based on an agricultural plot instance segmentation framework according to an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the technical solutions in this application, the following will clearly and completely describe the technical solutions in the embodiments of this application in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0020] According to an embodiment of the present invention, a method for extracting farmland parcels based on an agricultural parcel instance segmentation framework is provided.
[0021] The present invention will now be further described with reference to the accompanying drawings and specific embodiments. Figure 1 and Figure 5 As shown, according to one embodiment of the present invention, a method for extracting farmland plots based on an agricultural plot instance segmentation framework is provided, the method comprising the following steps: S1. Obtain remote sensing images of farmland plots and obtain a training set by preprocessing the remote sensing images; As a preferred embodiment, obtaining remote sensing images of farmland plots and preprocessing the remote sensing images to obtain a training set includes the following steps: S11, collecting source domain remote sensing images and target domain remote sensing images of farmland plots respectively, and obtaining annotation data corresponding to the source domain remote sensing images; S12, performing image preprocessing on the source domain remote sensing image and the target domain remote sensing image of the farmland plot to obtain a preprocessed source domain remote sensing image and a preprocessed target domain remote sensing image, respectively; As a preferred embodiment, the preprocessing includes: image cropping and image normalization; The image cropping is used to perform sliding cropping processing on the source domain remote sensing image and the target domain remote sensing image of the farmland plot based on a preset step size; The image normalization process is used to normalize the image pixel values of the source domain remote sensing image and the target domain remote sensing image of the farmland plot to the predicted pixel interval.
[0022] S13. Use the annotation data corresponding to the source domain remote sensing image to annotate the preprocessed source domain remote sensing image of the farmland plot to obtain a labeled source domain remote sensing image, and use the labeled source domain remote sensing image and the preprocessed target domain remote sensing image as a training set (when annotating, use software such as ArcMap and LabelMe to manually visually interpret and outline the scope and boundaries of the farmland plot to obtain high-precision farmland plot samples).
[0023] It should be noted that the preprocessing steps specifically include: (1) Image cropping: Since remote sensing images are usually large in size, they are cropped into fixed-size image blocks for ease of processing and training. In this embodiment, the image is cropped into image blocks of 512x512 pixels. The specific cropping method is: starting from the upper left corner of the image, sliding cropping is performed with a fixed step size; to avoid the cropping boundaries being too regular, a certain overlap area can be set. For example, the step size in both the horizontal and vertical directions can be set to 256 pixels, that is, there is a 256-pixel overlap between adjacent image blocks.
[0024] (2) Image normalization: Normalize the image pixel values to the range [0,1].
[0025] The specific method is: for each pixel value, subtract the minimum value from it, and then divide it by the difference between the maximum and minimum values.
[0026] S2. A region-based masked convolutional neural network is used to construct an unsupervised domain-adaptive agricultural field instance segmentation framework (UDA-FT) network model. It should be noted that if Figure 2 As shown in the figure, the UDA-FT model (Unsupervised Domain Adaptation for Agricultural Field Instance Segmentation Framework Network Model) introduces multiple structures based on the Mask R-CNN (Mask Region-based Convolutional Neural Network, a deep learning framework that excels in object detection and instance segmentation. It adds a mask prediction branch to the object detection framework, accurately identifying the location and category of each object in the image and generating a pixel-level segmentation mask for each object). These are: (1) Teacher-cross-domain student model architecture: A teacher-cross-domain student model architecture is introduced. The goal-oriented teacher model and the cross-domain student model share the same network structure but have different parameter update methods. The goal-oriented teacher model uses the exponential moving average (EMA) of the cross-domain student model parameters for update; (2) Image Adaptation Module: An image adaptation module is embedded in the feature extraction network of the cross-domain student model to align the image-level feature distributions of the source and target domains. Specifically, an image adaptation module is added after the FPN structure. FPN stands for Feature Pyramid Network. In the Mask R-CNN framework, FPN exists as the "neck" component, and its main function is to enhance the representation capability of multi-scale features. Furthermore, the image adaptation module is trained using an adversarial learning strategy, using a domain discriminator to distinguish whether features originate from the source or target domain. The domain discriminator consists of two fully connected layers: the first with an output dimension of 1024 and the second with an output dimension of 2, corresponding to the source and target domains, respectively. During training, a gradient reversal layer (GRL) is used to backpropagate the domain discriminator's losses to the feature extraction network. GRL acts as an identity mapping during forward propagation and multiplies the gradient by a negative coefficient (e.g., -0.1) during backpropagation, thereby encouraging the feature extraction network to learn domain-invariant feature representations.
[0027] (3) Instance Adaptation Module: An instance adaptation module is embedded after the RoIAlign layer of the cross-domain student model to align the instance-level feature distributions of the source and target domains. This module is also trained using an adversarial learning strategy, using a domain discriminator to distinguish instance features from different domains.
[0028] Among them, the domain discriminator of the instance adaptation module also consists of two fully connected layers, the output dimension of the first fully connected layer is 1024, and the output dimension of the second fully connected layer is 2; similar to the image adaptation module, the instance adaptation module also uses GRL to backpropagate the loss of the domain discriminator to the network layer before RoIAlign.
[0029] (4) Soft pseudo-label strategy: The target-oriented teacher model uses the Softmax function to output the probability map of the target domain image as a pseudo-label instead of using hard labels (i.e., 0 or 1). Soft pseudo-labels can provide richer information and help the cross-domain student model better learn the feature distribution of the target domain.
[0030] (5) CutMatch data enhancement: For the input target domain image, a part of the area is randomly cropped and replaced with another target domain image block. Specifically, a rectangular area is randomly selected and the pixel values in the area are replaced with the pixel values of the corresponding position in another target domain image. The size and position of the cropped area are random. Figure 3 shown.
[0031] Specifically, CutMatch solves the problem of differences in size and shape between different scenes and farm plots by randomly cropping and scaling the target domain image. Specifically, it first crops an area on the target domain remote sensing image, then resizes (enlarges or reduces) the cropped area, and then uses the target-guided teacher model weights to derive the predicted farmland plots and perform loss calculations with the cross-domain student model.
[0032] (6) LeakyMask data enhancement: For the input target domain image, a binary mask is randomly generated, and then the mask is weightedly fused with the original image; specifically, a binary mask with the same size as the input image is first generated, and the pixel values in the mask are set to 0 or 1 with a certain probability. Then, the mask is fused with the original image, as shown in Figure 4 shown.
[0033] Specifically, LeakyMask helps the model better capture spatial context by "leaking" some pixel information through the mask. Specifically, this method performs a random occlusion mask on the image. The unique feature is that it includes a pixel leakage mechanism that allows a controlled portion of the original pixel information to "leak" through the mask layer. In this way, even if part of the image is occluded, the model can still obtain potential contextual clues, thereby more effectively capturing local and global semantic information and enhancing the perception of the surrounding visual environment.
[0034] As a preferred embodiment, the unsupervised domain-adapted agricultural field instance segmentation framework network model includes a region-based masked convolutional neural network structure and a teacher-cross-domain student model architecture; The teacher-cross-domain student model architecture includes a goal-oriented teacher model and a cross-domain student model; The goal-oriented teacher model is used to generate pseudo labels for the target domain, and the weights of the goal-oriented teacher model are updated by the cross-domain student model through a sliding average method; The cross-domain student model is used to learn under the supervision of source domain labels and target domain pseudo labels, and an image adaptation module and an instance adaptation module are embedded in the cross-domain student model.
[0035] S3. Using the training set, the unsupervised domain-adapted agricultural field instance segmentation framework network model is trained to obtain a trained unsupervised domain-adapted agricultural field instance segmentation framework network model; As a preferred embodiment, the method of training the unsupervised domain-adapted agricultural field instance segmentation framework network model using the training set to obtain the trained unsupervised domain-adapted agricultural field instance segmentation framework network model includes the following steps: S31, pre-training the goal-oriented teacher model using a data augmentation method based on labeled source domain remote sensing images in a training set; As a preferred embodiment, the method of pre-training the goal-oriented teacher model using a data augmentation method based on labeled source domain remote sensing images in a training set includes the following steps: S311, using a data augmentation method to perform image transformation on the labeled source domain remote sensing images in the training set to obtain an enhanced data set; Data augmentation method (only for source domain): To improve the generalization and robustness of the model, data augmentation is performed on the source domain images. Specific methods include: Random cropping: Cropping is performed on the original image with a random ratio between 0.6 and 1.
[0036] Random Flip: Flip the image horizontally or vertically with a probability of 0.5.
[0037] Color Jitter: Randomly adjusts the brightness, contrast, saturation, and hue of the image. The brightness adjustment range is [0.6, 1.4], the contrast adjustment range is [0.6, 1.4], the saturation adjustment range is [0.6, 1.4], and the hue adjustment range is [-0.2, 0.2].
[0038] Gaussian blur: The image is Gaussian filtered with a probability of 0.5, a Gaussian kernel size of 3x3, and a standard deviation of a random value between [0.1, 2.0].
[0039] S312. Based on the enhanced dataset, the goal-oriented teacher model is trained in combination with the region-based masked convolutional neural network loss function and pre-configured training parameters.
[0040] S32. Adopting a consistent mutual learning strategy, using the labeled source domain remote sensing image and the pre-processed target domain remote sensing image, to collaboratively train the goal-oriented teacher model and the cross-domain student model; As a preferred embodiment, the consistent mutual learning strategy is adopted to collaboratively train the goal-oriented teacher model and the cross-domain student model using labeled source domain remote sensing images and pre-processed target domain remote sensing images, including the following steps: S321. Input the labeled source domain remote sensing image into the cross-domain student model and calculate the supervision loss of the cross-domain student model; S322, inputting the target domain remote sensing image into the target-oriented teacher model and the cross-domain student model respectively, and calculating the consistency loss between the prediction results of the cross-domain student model and the soft pseudo labels generated by the target-oriented teacher model; S323. Combine the supervision loss and consistency loss of the cross-domain student model to perform collaborative training of the goal-oriented teacher model and the cross-domain student model.
[0041] S33, using an exponential moving average method to update the parameters of the goal-oriented teacher model according to the parameters of the cross-domain student model; As a preferred embodiment, the expression for updating the parameters of the goal-oriented teacher model according to the parameters of the cross-domain student model using the exponential moving average method is: ; Where, θ t represents the parameters of the goal-oriented teacher model, θ s represents the parameters of the cross-domain student model, α is the exponential moving average attenuation coefficient, which is set to 0.9996 in this embodiment. t Indicates the update iteration round.
[0042] S34. Through the back-propagation algorithm, the parameters of the cross-domain student model are updated according to the supervision loss, consistency loss and domain adversarial loss.
[0043] Specifically, when the UDA-FT network model is trained using the training set, there are two stages: Phase 1: Pre-train the goal-oriented teacher model using strong data augmentation methods on the source domain. This phase uses only labeled source domain data for training. Strong data augmentation methods, including random cropping, flipping, color jittering, and random masking, are used to improve the generalization ability of the goal-oriented teacher model.
[0044] The target-oriented teacher model is trained using the standard Mask R-CNN loss function, including RPN loss, classification loss, detection head loss, and segmentation head loss. The RPN loss and detection head loss use the Smooth L1 loss function, while the classification head and segmentation head losses use the cross entropy loss function.
[0045] The maximum number of iterations was set to 30,000 steps. The initial learning rate was set to 0.02, and a warm-up strategy was implemented for the first 1,000 steps of training. Thereafter, a step-wise decay strategy was used to adjust the learning rate. Specifically, at step 25,000, the learning rate was reduced to 0.002. The batch size was fixed at 16 samples. The stochastic gradient descent (SGD) algorithm was used for parameter optimization.
[0046] Phase 2: A consistent mutual learning strategy is adopted to perform collaborative training using the goal-oriented teacher model and the cross-domain student model. This phase uses both labeled source domain data and unlabeled target domain data for training.
[0047] For source domain data: The source domain image is input into the cross-domain student model, and the source domain label is used to calculate the supervision loss. The supervision loss includes RPN loss, detection head loss, classification loss, and segmentation head loss, and the calculation method is the same as the first stage.
[0048] For target domain data: the target domain images are input into the target-oriented teacher model and the cross-domain student model respectively.
[0049] Goal-oriented teacher model: After performing weak enhancement operations such as random cropping and flipping on the target domain image, the model is input into the network for prediction to generate a probability distribution of soft pseudo labels.
[0050] The cross-domain student model mainly includes the following aspects: Input: Target domain image that has been randomly cropped, flipped, color-jittered, randomly masked, CutMatched, and LeakyMask-enhanced.
[0051] Loss function: Consistency loss is used to measure the consistency between the prediction results of the cross-domain student model and the soft pseudo labels generated by the target-oriented teacher model. The consistency loss is calculated using the cross-entropy loss function and the L1 loss function.
[0052] The image adaptation module and instance adaptation module are trained using an adversarial learning strategy. Specifically, image features and instance features are fed into their respective domain discriminators, which output a binary probability representing the probability that the feature originates from the source domain or the target domain. GRL is used to backpropagate the domain discriminator loss to the feature extraction network and the network layers before RoIAlign, prompting the network to learn domain-invariant feature representations. The domain discriminator uses a cross-entropy loss function.
[0053] Among them, the parameters of the goal-oriented teacher model are updated using the exponential moving average (EMA) method, and the parameters of the goal-oriented teacher model are updated according to the parameters of the cross-domain student model.
[0054] Cross-domain student model parameter update uses the back-propagation algorithm to update the parameters of the cross-domain student model according to the supervision loss, consistency loss, and domain adversarial loss.
[0055] In addition, the loss function of the training process includes: Source domain supervision loss: ; Where, L sup represents the source domain supervision loss, L rpn represents the RPN loss, L det Indicates the loss of the detection head, L segrepresents the segmentation head loss, L cls represents the classification loss.
[0056] The target domain consistency loss consists of two parts: RPN loss and ROI loss. The RPN loss is: ; Where, L rpn represents the RPN loss, and denote the parameters of the cross-domain student model and the target-oriented teacher model positioning network, A represents the anchor point, and and Represent strong and weak enhancement data input respectively, σ Represents the sigmoid activation function. The positioning loss uses smooth L1 loss, and the classification loss uses cross entropy loss. s represents the cross-domain student model, t Represents the goal-oriented teacher model.
[0057] ROI loss includes detection head loss, classification loss and segmentation head loss: ; Where, L roi represents ROI loss, 、 and They represent the bounding box positioning loss, classification loss, and segmentation loss of RoI Head respectively. 、 and Represent the parameters of the bounding box localization network, classification network, and segmentation network of the cross-domain student model, respectively. 、 and denote the parameters of the bounding box localization network, classification network, and segmentation network of the goal-oriented teacher model, respectively. and Represents the output of RPN; consistent with the loss function used in RPN mutual learning, the loss functions for bounding box positioning and classification use smooth L1 loss and cross entropy loss respectively. σ Represents the sigmoid activation function.
[0058] In addition, the auxiliary loss function introduced in the RoI Head mutual learning framework for segmentation purposes also adopts cross entropy loss.
[0059] The expression of domain adversarial loss is: ; Where, L adv represents the domain adversarial loss, represents the domain discriminator loss of the image adaptation module, represents the domain discriminator loss of the instance adaptation module.
[0060] Among them, the total loss function is: ; Where, L total Represents the total loss function.
[0061] In addition, the hyperparameters of the network model training for the unsupervised domain adaptation agricultural field instance segmentation framework are set as follows: The optimizer is SGD (Stochastic Gradient Descent); The initial learning rate is 0.002; Learning rate decay strategy: adopt polynomial decay strategy, the formula is as follows: lr=base_lr*(1-iter / max_iter)^power; Where lr represents the current learning rate, base_lr represents the initial learning rate, iter represents the current number of iterations, max_iter represents the total number of iterations, and power represents the decay exponent, which is set to 0.9.
[0062] Weight decay is 0.0001; Momentum is 0.9; Batch size is 16; The number of iterations is 55000; The EMA decay coefficient is 0.9996; S4. The trained unsupervised domain-adapted agricultural field instance segmentation framework network model is used to extract farmland plots from the target domain remote sensing image to be identified.
[0063] As a preferred embodiment, the unsupervised domain-adapted agricultural field instance segmentation framework network model completed by training extracts farmland plots from the target domain remote sensing image to be identified, including the following steps: S41, inputting the target domain remote sensing image to be identified into the trained unsupervised domain-adapted agricultural field instance segmentation framework network model to obtain a probability map of each pixel belonging to the farmland plot; S41. Based on the predicted threshold, the probability map of the farmland plot is binarized to obtain the final farmland plot extraction result.
[0064] Specifically, the target domain remote sensing image to be identified is input into the trained UDA-FT network model to obtain the probability map of each pixel belonging to the farmland plot. Then, according to the preset threshold (for example, 0.5), the probability Figure 2 The final farmland plot extraction result is obtained.
[0065] According to another embodiment of the present invention, a farmland parcel extraction system based on an agricultural parcel instance segmentation framework is provided, comprising: A training set construction module is used to construct a training set, which includes labeled source domain remote sensing images and unlabeled target domain remote sensing images; A model building module is used to build the UDA-FT network model based on the Mask R-CNN framework. The UDA-FT network model adopts a teacher-cross-domain student model architecture, including a goal-oriented teacher model and a cross-domain student model. The cross-domain student model is embedded in the image adaptation module and the instance adaptation module. The training module is used to train the UDA-FT network model using the training set; The recognition module is used to extract farmland plots from the target domain remote sensing image through the trained UDA-FT network model.
[0066] To better understand this solution, let’s take the extraction of farmland plots from Denmark (source domain) to Japan (target domain) as an example: (1) Data preparation Source data: Remote sensing imagery of Denmark and its corresponding annotated farmland plots. The imagery used is Esri imagery with a spatial resolution of 1.5 meters and was acquired in May 2016. The annotated data comes from the 2016 Danish "Market" dataset.
[0067] Target domain data: Unlabeled remote sensing imagery of Japan. The imagery used is from Esri (Environmental Systems Research Institute, a leading global provider of geographic information system software and solutions), with a spatial resolution of 1.5 meters. The imagery was acquired between March and October 2016.
[0068] Data preprocessing: The remote sensing images of both the source and target domains are cropped into image blocks of 512x512 pixels and normalized.
[0069] (2) Model construction The UDA-FT network model is constructed based on the MaskR-CNN framework, and ResNet-101 is used as the backbone network.
[0070] The goal-oriented teacher model and the cross-domain student model share the same network structure.
[0071] The cross-domain student model embeds an image adaptation module and an instance adaptation module.
[0072] (3) Model training Phase 1: Pre-train a target-oriented teacher model using source domain data and strong data augmentation methods (e.g., random cropping, flipping, color jittering, random masking).
[0073] Phase 2: Adopt a consistent mutual learning strategy to collaboratively train the goal-oriented teacher model and the cross-domain student model.
[0074] The source domain image is fed into the cross-domain student model and the supervision loss is calculated.
[0075] The target domain images are input into the target-oriented teacher model and the cross-domain student model respectively. The target-oriented teacher model generates soft pseudo labels, and the cross-domain student model learns under the supervision of the soft pseudo labels and calculates the consistency loss.
[0076] CutMatch and LeakyMask data augmentation methods are used to improve the generalization ability of the model.
[0077] The image adaptation module and instance adaptation module are trained using an adversarial learning strategy and implemented using the Gradient Reversal Layer (GRL).
[0078] (4) Farmland plot extraction The remote sensing image of the Japanese area to be identified is input into the trained UDA-FT network model to obtain the extraction results of farmland plots.
[0079] Experimental results show that the method proposed in this paper can effectively improve the accuracy of cross-regional farmland plot extraction. Compared with the model trained only with source domain data, the mAP index is improved by more than 10%.
[0080] In summary, with the help of the above-mentioned technical solution of the present invention, the present invention effectively solves the domain offset problem of cross-regional and cross-sensor farmland plot extraction by constructing a UDA-FT network model and adopting a teacher-cross-domain student model architecture and a consistent mutual learning strategy, thereby improving the accuracy and robustness of farmland plot extraction.
[0081] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, optical storage, etc.) containing computer-usable program code.
[0082] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A farmland plot extraction method based on an agricultural field instance segmentation framework, characterized in that: The method comprises the following steps: S1. Obtain remote sensing images of farmland plots and obtain a training set by preprocessing the remote sensing images; S2. Region-based masked convolutional neural network to build an unsupervised domain-adaptive agricultural field instance segmentation framework network model; S3. Using the training set, the unsupervised domain-adapted agricultural field instance segmentation framework network model is trained to obtain a trained unsupervised domain-adapted agricultural field instance segmentation framework network model; S4. The trained unsupervised domain-adapted agricultural field instance segmentation framework network model is used to extract farmland plots from the target domain remote sensing image to be identified.
2. The farmland plot extraction method based on the agricultural field instance segmentation framework according to claim 1 is characterized in that: The step of obtaining remote sensing images of farmland plots and preprocessing the remote sensing images to obtain a training set includes the following steps: S11, collecting source domain remote sensing images and target domain remote sensing images of farmland plots respectively, and obtaining annotation data corresponding to the source domain remote sensing images; S12, performing image preprocessing on the source domain remote sensing image and the target domain remote sensing image of the farmland plot to obtain a preprocessed source domain remote sensing image and a preprocessed target domain remote sensing image, respectively; S13. Use the annotation data corresponding to the source domain remote sensing image to annotate the preprocessed source domain remote sensing image of the farmland plot to obtain a labeled source domain remote sensing image, and use the labeled source domain remote sensing image and the preprocessed target domain remote sensing image as a training set.
3. The farmland plot extraction method based on the agricultural field instance segmentation framework according to claim 2 is characterized in that: The preprocessing includes: image cropping and image normalization; The image cropping is used to perform sliding cropping processing on the source domain remote sensing image and the target domain remote sensing image of the farmland plot based on a preset step size; The image normalization process is used to normalize the image pixel values of the source domain remote sensing image and the target domain remote sensing image of the farmland plot to the predicted pixel interval.
4. The farmland plot extraction method based on the agricultural field instance segmentation framework according to claim 1 is characterized in that: The unsupervised domain adaptation agricultural field instance segmentation framework network model includes a region-based mask convolutional neural network structure and a teacher-cross-domain student model architecture; The teacher-cross-domain student model architecture includes a goal-oriented teacher model and a cross-domain student model; The goal-oriented teacher model is used to generate pseudo labels for the target domain, and the weights of the goal-oriented teacher model are updated by the cross-domain student model through a sliding average method; The cross-domain student model is used to learn under the supervision of source domain labels and target domain pseudo labels, and an image adaptation module and an instance adaptation module are embedded in the cross-domain student model.
5. The method for extracting farmland plots based on the agricultural plot instance segmentation framework according to claim 4, characterized in that: The method of training the unsupervised domain-adapted agricultural field instance segmentation framework network model using the training set to obtain the trained unsupervised domain-adapted agricultural field instance segmentation framework network model comprises the following steps: S31, pre-training the goal-oriented teacher model using a data augmentation method based on labeled source domain remote sensing images in a training set; S32. Adopting a consistent mutual learning strategy, using the labeled source domain remote sensing image and the pre-processed target domain remote sensing image, to collaboratively train the goal-oriented teacher model and the cross-domain student model; S33, using an exponential moving average method to update the parameters of the goal-oriented teacher model according to the parameters of the cross-domain student model; S34. Through the back-propagation algorithm, the parameters of the cross-domain student model are updated according to the supervision loss, consistency loss and domain adversarial loss.
6. The method for extracting farmland plots based on the agricultural plot instance segmentation framework according to claim 5, characterized in that: The method of pre-training the goal-oriented teacher model based on the labeled source domain remote sensing images in the training set using a data augmentation method includes the following steps: S311, using a data augmentation method to perform image transformation on the labeled source domain remote sensing images in the training set to obtain an enhanced data set; S312. Based on the enhanced dataset, the goal-oriented teacher model is trained in combination with the region-based masked convolutional neural network loss function and pre-configured training parameters.
7. The method for extracting farmland plots based on the agricultural plot instance segmentation framework according to claim 6, characterized in that: The image transformation of the labeled source domain remote sensing images in the training set using the data enhancement method includes: Random cropping is used to crop labeled source domain remote sensing images in the training set according to random proportions; Random flipping is used to flip the labeled source domain remote sensing images in the training set with a preset probability; Color jittering is used to randomly adjust the brightness, contrast, saturation, and hue of labeled source domain remote sensing images in the training set; Gaussian blurring performs Gaussian filtering on labeled source domain remote sensing images in the training set with a preset probability.
8. The method for extracting farmland plots based on the agricultural plot instance segmentation framework according to claim 5, characterized in that: The method adopts a consistent mutual learning strategy and uses labeled source domain remote sensing images and pre-processed target domain remote sensing images to collaboratively train the goal-oriented teacher model and the cross-domain student model, including the following steps: S321. Input the labeled source domain remote sensing image into the cross-domain student model and calculate the supervision loss of the cross-domain student model; S322, inputting the target domain remote sensing image into the target-oriented teacher model and the cross-domain student model respectively, and calculating the consistency loss between the prediction results of the cross-domain student model and the soft pseudo labels generated by the target-oriented teacher model; S323. Combine the supervision loss and consistency loss of the cross-domain student model to perform collaborative training of the goal-oriented teacher model and the cross-domain student model.
9. The method for extracting farmland plots based on the agricultural plot instance segmentation framework according to claim 5, characterized in that: The expression for updating the parameters of the goal-oriented teacher model based on the parameters of the cross-domain student model using the exponential moving average method is: ; Where, θ t represents the parameters of the goal-oriented teacher model, θ s represents the parameters of the cross-domain student model, α is the exponential moving average decay coefficient, t Indicates the update iteration round.
10. The method for extracting farmland plots based on the agricultural plot instance segmentation framework according to claim 1, characterized in that: The unsupervised domain-adapted agricultural field instance segmentation framework network model completed by training extracts farmland plots from the target domain remote sensing image to be identified, including the following steps: S41, inputting the target domain remote sensing image to be identified into the trained unsupervised domain-adapted agricultural field instance segmentation framework network model to obtain a probability map of each pixel belonging to the farmland plot; S41. Based on the predicted threshold, the probability map of the farmland plot is binarized to obtain the final farmland plot extraction result.
Citation Information
Cited By
Farmland parcel boundary instance segmentation method, system, equipment and medium
CN121962618A