Remote sensing farmland plot extraction method based on attention mechanism
By constructing the HAGNet model and utilizing bridging layers, high- and low-frequency attention modules, and attention gating mechanisms, the problem of balancing high-frequency boundary details and low-frequency global semantics in remote sensing farmland plot extraction was solved, achieving high-precision farmland plot segmentation and improving the model's robustness and feature representation capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI NORMAL UNIV
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-17
AI Technical Summary
Existing convolutional neural networks struggle to balance high-frequency boundary details with low-frequency global semantics in remote sensing farmland plot extraction, leading to problems such as missed detection of small plots, blurred and overlapping plot boundaries, and weak resistance to background interference.
The HAGNet model is constructed using an encoder and decoder structure, combined with a bridging layer, high and low frequency attention modules, and an attention gating mechanism. Feature resolution is recovered through bottom-up decoding, and gating signals are introduced in skip connections to achieve adaptive feature selection and high-quality fusion.
It effectively solves the problems of blurred farmland boundaries, complex scenes, and high similarity of interfering features, and achieves high-precision farmland segmentation, improving robustness and feature representation capabilities, and can accurately identify multi-scale farmland plots in various remote sensing scenarios.
Smart Images

Figure CN121884162A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of remote sensing image processing and computer vision technology, and in particular to a remote sensing farmland plot extraction method based on an attention mechanism. Background Technology
[0002] High-resolution remote sensing images contain rich details of ground features. Farmland plots, as a major feature within these images, are characterized by irregular shapes, significant scale differences, and dense spatial distribution. Accurately extracting the boundary information and global contours of these plots is crucial for precision agriculture management. Therefore, researchers have widely utilized convolutional neural networks (CNNs) for farmland plot extraction. The classic U-Net architecture, through its encoder-decoder structure and skip connections, has achieved, to some extent, the fusion of multi-scale features.
[0003] However, due to the inherent limitations of the local receptive field in convolutional operations, pure CNN architectures are naturally insufficient in capturing long-range dependencies and global contextual information, making it difficult to handle the holistic extraction of large-scale plots. In recent years, attention mechanisms have been introduced to enhance the model's ability to focus on key features, becoming an important means to improve semantic segmentation performance. Various attention modules attempt to highlight target regions through weighted methods, but when faced with complex background noise in farmland environments (such as field ridges, roads, and ditches) and the high heterogeneity of plot scale, existing single attention mechanisms often struggle to balance high-frequency boundary details with low-frequency global semantics. Furthermore, existing methods still have shortcomings in handling complex background interference and multi-scale plot coexistence scenarios, such as the tendency to miss small plots, blurred and adhered plot boundaries, and weak resistance to background interference, which need further solutions. Therefore, this paper proposes a remote sensing farmland plot extraction method based on an attention mechanism. Summary of the Invention
[0004] The purpose of this invention is to solve the problems in the prior art by proposing a remote sensing farmland plot extraction method based on an attention mechanism.
[0005] A remote sensing method for extracting farmland plots based on an attention mechanism includes the following steps: S1. Receive remote sensing images and perform preprocessing; S2. Construct and train the HAGNet model; The HAGNet model includes an encoder and a decoder. A bridging layer and a high- and low-frequency attention module are set between the encoder and the decoder to enhance the representation of deep features from the frequency domain perspective. The encoder, based on a ResNet encoder structure, is used to extract features from remote sensing images at different scales. The decoder recovers the feature resolution step by step through bottom-up multi-level decoding and filters out noise information in encoder skip connections through an attention gating mechanism. S3. Input the preprocessed image into the trained HAGNet model and output the farmland plot segmentation results.
[0006] Preferably, in step S1, the preprocessing includes pixel normalization and channel normalization.
[0007] Preferably, in step S2, the encoder consists of an input convolutional layer, a max pooling layer, and multiple depth residual modules; First, the input convolutional layer is used to extract shallow texture features:
[0008] in, This is the preprocessed remote sensing image; Then max pooling is performed to obtain the downsampled feature map:
[0009] Then, the results are obtained sequentially through multiple residual modules:
[0010] Each residual element satisfies:
[0011] in This represents a nonlinear transformation combining two convolutional layers and batch normalization.
[0012] Preferably, in step S2, the bridging layer is used to transfer the deep features output by the encoder. Its semantic representation capability is enhanced by performing two consecutive convolutions:
[0013] Features Rearranged as: ; High- and low-frequency attention modules include: (1) Low-frequency attention modeling of global semantics, as follows: For input features Perform a linear transformation:
[0014] Downsampling is performed using average pooling:
[0015] Calculate the key-value vector:
[0016] Calculate attention:
[0017] Obtain low-frequency attention output:
[0018] (2) High-frequency attention extracts boundary details, as follows: Divide the features into local windows:
[0019] Calculate self-attention within the window:
[0020] Obtain high-frequency attention output:
[0021] (3) Fusion of high and low frequency features Concatenate the two types of features:
[0022] Restore convolution format: .
[0023] Preferably, in step S2, the decoder consists of multiple decoding layers, and each decoding layer includes: an upsampling unit, an attention gating unit, a feature concatenation unit, and a dual convolutional fusion unit; (1) Upsampling unit The spatial dimensions of the features upsampled to the previous encoder stage using deconvolution or bilinear interpolation are denoted as:
[0024] in, Indicates the first Level decoding layer, Indicates input to the first Features of the decoding layer Indicates an upsampling operation; when = hour, for That is, the output of the high and low frequency attention modules is limited to the "first-level" decoding layer; the others... These are the output features of the previous decoding layer. The number of levels in the decoding layer of the decoder; (2) Attention gating unit For the gated signal from the decoder shallow features of the encoder Map both to the same channel dimension:
[0025] in, for Convolution, upsampling output As a gating signal ; Add the mapped features element by element:
[0026] Use Sigmoid activation to generate attention weights:
[0027] in, , for convolution; Filtering features: .
[0028] (3) Feature splicing unit Upsampled output and filtered gated features splicing:
[0029] (4) Dual convolutional fusion unit Then, the two convolutional structures are used for fusion:
[0030] Each of them Include Convolution, batch normalization, and ReLU activation.
[0031] Preferably, in step S3, the output of the HAGNet model... For: the final output of the decoder pass Convolution performs class mapping:
[0032] in, A segmented diagram representing farmland and the background.
[0033] Preferably, the output result Softmax activation can be used as the probability prediction method, and a thresholding method can be used to convert the probability map into a binary mask as the final farmland plot segmentation result.
[0034] Preferably, the bilinear interpolation is used for size alignment, specifically: if Then execute: .
[0035] Preferably, the training of the HAGNet model employs a composite loss function, which includes cross-entropy loss and Dice loss:
[0036] The cross-entropy loss is:
[0037] Dice's loss is:
[0038] in, and The value range is 0.3–0.7.
[0039] Compared with existing technologies, the advantages of this invention are: 1. This invention constructs an encoder-bridge layer-decoder structure, which makes full use of deep semantic features and shallow detail features. At the same time, it decomposes and models the features from the frequency domain perspective, and introduces a gating signal in the skip connection process to achieve adaptive selection and high-quality fusion of features. It effectively solves the problems of blurred farmland boundaries, complex scenes and high similarity of interfering ground features, and can achieve high-precision farmland segmentation in a variety of remote sensing scenarios.
[0040] 2. The farmland plot extraction method based on high and low frequency attention and attention gating mechanism of this invention is significantly superior to existing deep learning segmentation methods in terms of robustness, feature representation ability, boundary recognition quality and complex background processing ability. It can accurately identify farmland plots at multiple scales and has good engineering application value and promotion significance. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the overall process of the remote sensing farmland plot extraction method of the present invention.
[0042] Figure 2 This is a schematic diagram of the high and low frequency attention module in this invention.
[0043] Figure 3 This is a schematic diagram of the attention gating unit in this invention.
[0044] Figure 4 This is a schematic diagram of the segmentation results of the present invention in a typical remote sensing farmland scene. Detailed Implementation
[0045] To facilitate understanding of this application and to make the aforementioned objectives, features, and advantages of this application more apparent, a detailed description of specific embodiments of this application is provided below in conjunction with the accompanying drawings. Numerous specific details are set forth in the following description to provide a thorough understanding of this application, and preferred embodiments are shown in the accompanying drawings. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application. This application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified. In the description of this application, "several" means at least one, such as one, two, etc., unless otherwise explicitly specified. It should be noted that when an element is referred to as being "fixed to" another element, it can be directly attached to the other element or there may be an intervening element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or there may be an intervening element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementations. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is only for describing particular implementations and is not intended to limit the scope of this application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0046] A remote sensing method for extracting farmland plots based on an attention mechanism includes the following steps: S1. Receive remote sensing images and perform preprocessing. Reference Figure 1 As shown, a high-resolution remote sensing image I is received, with dimensions of 3×H×W, where 3 represents the three RGB channels. The input remote sensing image is denoted as:
[0047] First, the image undergoes standardization preprocessing, including pixel normalization and channel normalization. A channel-based linear transformation is used to map pixel values to the [0,1] interval, ensuring the image meets the input requirements of a deep learning model (HAGNet model). After this processing, the preprocessed image is obtained.
[0048] in, This refers to data augmentation and preprocessing operations, which can be automated through a data pipeline without human intervention.
[0049] S2. Construct and train the HAGNet model. 1. Encoder A ResNet-based encoder structure (preferably a ResNet50 encoder structure) is used to extract features from remote sensing images at different scales. The encoder consists of an input convolutional layer, a max-pooling layer, and multiple ( It consists of a deep residual module, which is used to extract shallow texture, mid-level structure and deep semantic features respectively.
[0050] First, the input convolutional layer uses Convolution kernel, padding 1, stride 1, used to extract shallow texture features:
[0051] in, This is the preprocessed remote sensing image; Then after Max pooling is used to obtain downsampled feature maps.
[0052] Then, the results are obtained sequentially through multiple residual modules:
[0053] Indicates the first The characteristics output by each residual module Represents the depth residual module; like Figure 1 As shown, in this embodiment, the encoder consists of an input convolutional layer, a max pooling layer, and four depth residual modules, which sequentially pass through the four residual modules to obtain:
[0054] First residual module output The first residual module is used to extract low-level structures; the second residual module outputs... Used to extract the middle layer structure; the third residual module outputs... The fourth residual module is used to extract complex texture structures; it outputs deep semantic features. Each residual unit satisfies:
[0055] in, This represents a nonlinear transformation combining two convolutional layers and batch normalization. This represents the input characteristics of the residual unit. The residual module structure represents the output features of the residual unit. It can effectively alleviate the gradient vanishing problem in deep networks and improve the expressive power of high-dimensional features, thus meeting the segmentation needs of farmland plots of varying sizes and complex shapes.
[0056] Preferably, the number of output channels of the encoder's four-level residual module are 256, 512, 1024 and 2048, respectively, to ensure feature richness under multi-scale plot structures.
[0057] 2. A bridging layer and high / low frequency attention modules are set between the encoder and decoder. like Figure 2 As shown, the bridging layer and the high- and low-frequency attention modules are used to enhance the representation capability of deep features from the frequency domain perspective. Deep features output by the encoder The input bridging layer enhances its semantic representation capabilities through two consecutive convolutions:
[0058] The bridging layer consists of two consecutive convolutional blocks. Each convolutional block includes a convolutional layer, a batch normalization layer, and a ReLU activation function. The number of output channels of the bridging layer is consistent with the highest layer of the encoder to reduce information loss.
[0059] Then the features The rearrangement operation ensures that subsequent matrix multiplications can be correctly applied to the feature channel dimension, thereby effectively decomposing and modeling global semantics and local details in the frequency domain. ; The high-low frequency attention module employs a high-low frequency attention mechanism (HiLo Attention) to decompose deep features in the frequency domain into a low-frequency global semantic branch (Lo-Fi) and a high-frequency local texture branch (Hi-Fi), specifically including: (1) Low-frequency attention modeling of global semantics, as follows: For input features Perform a linear transformation:
[0060] in, The query matrix represents the low-frequency branches. This represents the rearranged input serialization features. This represents the learnable linear projection matrix used to generate the query vector; Downsampling is performed using average pooling:
[0061] in, This represents the low-frequency feature map after downsampling. This indicates the average pooling operation. This represents the window size for average pooling, used to reduce computation and extract global information; Calculate the key-value vector:
[0062] in, These represent the key matrix and value matrix of the low-frequency branch, respectively. This represents the learnable linear projection matrix used to simultaneously generate key-value pairs; Calculate attention:
[0063] in, This represents the calculated low-frequency global attention map. This represents the transpose of the low-frequency branch bond matrix. Indicates the feature channel dimension. Scaling factor This represents the normalized exponential function; Obtain low-frequency attention output:
[0064] (2) High-frequency attention extracts boundary details, as follows: Divide the features into local windows:
[0065] in, This represents dividing the feature map into multiple non-overlapping local window features, used to limit the scope of attention computation to capture local details. This indicates a window partitioning operation; Calculate self-attention within the window:
[0066] Wherein, represents the calculated high-frequency local self-attention map. and These represent the transposes of the query matrix and key matrix for high-frequency branches within the local window, respectively. Indicates the feature channel dimension. This is the scaling factor; Obtain high-frequency attention output:
[0067] in, This represents the output features of the high-frequency attention branch that has extracted boundary detail information. The value matrix representing the high-frequency branches is derived from local window features. Obtained by linear projection.
[0068] (3) Fusion of high and low frequency features Concatenate the two types of features:
[0069] Restore the convolutional format and use it as decoder input: .
[0070] 3. Decoder The decoder recovers feature resolution step by step through bottom-up multi-level decoding and filters noise information in encoder skip connections using an attention gating mechanism. The decoder consists of multiple levels ( The decoding layer consists of a multi-level module, each level of which includes: an upsampling unit, an attention gating unit, a feature concatenation unit, and a dual convolutional fusion unit, such as... Figure 1 As shown, the decoder in this implementation consists of six decoding layers; (1) Upsampling unit The spatial size of the features from the previous encoder is upsampled using deconvolution (transposed convolution) or bilinear interpolation. Preferably, a ConvTranspose2D structure is used, which can learn upsampling weights to make the spatial reconstruction process more adaptive. The upsampling stride is set to 2, and the spatial size is expanded to twice its original size after upsampling. The upsampled output is denoted as:
[0071] in, Indicates the first Level decoding layer, Indicates input to the first Features of the decoding layer Indicates an upsampling operation; when = hour, for That is, the output of the high and low frequency attention modules is limited to the "first-level" decoding layer; the others... These are the output features of the previous decoding layer; (2) Attention gating unit Attention gating units are placed at the jump connections of each decoding layer to suppress shallow features in non-farmland areas, ensuring effective alignment between shallow textures and deep semantics. This is achieved for the gating signals from the decoder. shallow features of the encoder Map both to the same channel dimension:
[0072] in, for Convolution, upsampling output As a gating signal ; Add the mapped features element by element:
[0073] Use Sigmoid activation to generate attention weights:
[0074] in, , for convolution; Filtering features: .
[0075] (3) Feature splicing unit Upsampled output and filtered gated features splicing:
[0076] (4) Dual convolutional fusion unit Then, the two convolutional structures are used for fusion:
[0077] Each of them Include Convolution, batch normalization, and ReLU activation.
[0078] In practice, due to differences in padding values between different convolutions or pooling methods, the upsampled features and the features from the encoder's skip connections may have a spatial size deviation of 1 pixel. Therefore, bilinear interpolation is used for size alignment, specifically: if... Then execute:
[0079] Using align_corners=True maintains the smoothness and spatial consistency of the boundaries. This strategy ensures that the feature stitching operation will not cause information offset due to inconsistent sizes, thereby improving the quality of boundary restoration.
[0080] S3. Input the preprocessed image into the trained HAGNet model, and output the farmland plot segmentation results. After multiple levels of decoding, the final feature map is obtained. ,pass Convolution is used to map categories to the output of the HAGNet model. :
[0081] in A segmented diagram representing farmland and the background.
[0082] Pixel-level classification probabilities are obtained using Softmax activation:
[0083] Furthermore, a thresholding method can be used to convert the probability map into a binary mask, which can be used for downstream tasks such as farmland area calculation and plot shape analysis.
[0084] This embodiment specifically includes the following steps: 1. Input remote sensing image Normalization and standardization are performed as preprocessing steps to obtain... .
[0085] 2. The encoder extracts features to obtain multi-scale representations. .
[0086] 3. The bridging layer enhances semantic features and inputs them into the high- and low-frequency attention module; 4. Perform high-frequency window attention and low-frequency downsampling attention to obtain deep features after frequency domain decomposition; 5. The six-level attention-gated decoder gradually restores the spatial size, with each level performing upsampling, gating filtering, feature concatenation, and dual convolutional fusion; 6. Output layer generates segmentation map ; 7. Softmax + thresholding to obtain the final farmland plot mask.
[0087] The HAGNet model of this invention is trained in an end-to-end manner. First, the remote sensing images in the training set are preprocessed and then input into the encoder-high and low frequency attention module-decoder structure model proposed in this invention. The model outputs the prediction results of farmland / background and performs backpropagation and optimization of the model parameters through a composite loss function.
[0088] In this embodiment, the model training process executes the following steps in a loop: (1) Randomly sample a batch of images from the training set, denoted as .
[0089] (2) Perform preprocessing and data augmentation on the input image to obtain , .
[0090] (3) The input model sequentially obtains encoder features, bridging layer features, high- and low-frequency attention features, and six-level decoder features, ultimately yielding the predicted segmentation map.
[0091] (4) Calculate the loss function and perform backpropagation.
[0092] (5) Update parameters using optimization algorithms (such as Adam or SGD). .
[0093] The optimization process is iterative until the preset convergence condition is met.
[0094] In this implementation, training can be performed in a mini-batch manner to balance training stability and memory usage. During training, data augmentation includes operations such as random flipping, random rotation, random pruning, scale perturbation, and color jittering to improve the model's robustness under different lighting conditions, seasons, and ground cover interference, and to enhance the model's generalization ability in multi-plot scenarios.
[0095] To improve the model's classification ability, boundary recognition ability, and ability to handle class imbalance problems, this invention employs a composite loss function, which includes cross-entropy loss and Dice loss:
[0096] The cross-entropy loss is:
[0097] Dice's loss is:
[0098] in, and The value ranges from 0.3 to 0.7. The optimal ratio was determined through experiments. In this invention, Dice loss is used to enhance the sensitivity of the boundary area, which can significantly improve the continuity of farmland boundaries and the ability to identify small land features.
[0099] Furthermore, to enhance the model's ability to detect small plots, boundary auxiliary losses, such as edge detection loss and Hausdorff distance loss, can be added to improve the model's ability to capture linear field ridges.
[0100] In this embodiment, the training hyperparameters can be set as follows: (1) The learning rate is preferably 1e-4, which can be dynamically adjusted by using cosine annealing or multi-step descent strategy.
[0101] (2) The batch size is preferably 4–16, which can be adjusted according to the video memory capacity.
[0102] (3) The number of training rounds is preferably 50–300 times, which can be flexibly set according to the amount of data.
[0103] (4) Kaiming initialization is preferred for weight initialization to improve model convergence speed and training stability.
[0104] (5) The optimizer prefers Adam. .
[0105] (6) Regularization can adopt a weight decay strategy, and the decay coefficient is preferably 1e-4.
[0106] In this embodiment, the model can be deployed in various environments such as servers, cloud platforms, and edge computing devices. The preferred hardware environment is an NVIDIA GPU (such as the RTX series or A100 series) to improve inference speed.
[0107] To verify the effectiveness and superiority of the remote sensing farmland plot extraction method based on high and low frequency attention and attention gating mechanism proposed in this invention, this study conducted a comprehensive quantitative comparison and ablation experiment with existing mainstream segmentation models on the publicly available high-resolution farmland plot FHAPD dataset. Four representative semantic segmentation models were selected: U-Net, PSPNet, DeepLabV3plus, and FCN.
[0108] Table 1. Comparison of models on the dataset
[0109] Table 2 Ablation experiments of the HAGNet model on the dataset.
[0110] As shown in Table 1, the experimental results demonstrate that the proposed HAGNet model exhibits a significant accuracy advantage over existing mainstream methods in the task of extracting farmland plots from remote sensing images. Through its carefully designed network architecture, HAGNet can more effectively extract and fuse multi-scale features, significantly improving the segmentation of feature edges and detailed regions while maintaining global semantic consistency, thus achieving more accurate pixel-level classification. The results in the first comparative experiment table show that the proposed HAGNet method outperforms other comparative methods (UNet, PSPNet, DeepLabV3Plus, and FCN) in five key metrics: Accuracy, Precision, Recall, F1 Score, and mIoU. HAGNet achieves the highest segmentation performance, with an mIoU of 88.78% and an F1 Score of 94.05%. Compared to the second-best performing UNet model, HAGNet outperforms it by 2.72 percentage points in mIoU and 1.55 percentage points in F1 score. Furthermore, its accuracy and precision reach top levels of 94.07% and 94.21%, respectively. These experimental data fully demonstrate the effectiveness and superiority of the proposed method in improving the accuracy of remote sensing image segmentation.
[0111] As shown in Table 2, the experimental results further validated the key roles of the proposed core components—the High-Low Frequency Attention Module (HiLo) and the Attention Gating Unit (AG)—in improving model performance through ablation experiments. The baseline model's feature representation capability was significantly enhanced after introducing these innovative components. The HiLo module, by processing high-frequency and low-frequency information separately, helps the model simultaneously capture fine texture details and macroscopic structural features; while the AG module suppresses irrelevant background noise through an attention mechanism, enabling the model to focus more on feature learning in the target region. As shown in the ablation experiment table, adding the HiLo module alone to the baseline model improved the mIoU from 86.06% to 88.00%; adding the AG module alone improved the mIoU to 87.54%. When both the HiLo and AG modules were integrated to construct the complete HAGNet, all model metrics reached their optimal levels, with the mIoU further improved to 88.78% and the F1 Score reaching 94.05%. This indicates that the two modules not only have good individual improvement effects, but also form an effective synergy, jointly enhancing the model's adaptability to complex remote sensing scenes and segmentation accuracy.
[0112] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative in all respects and are not the only ones. All modifications within the scope of this invention or its equivalents are included in this invention.
Claims
1. A remote sensing method for extracting farmland plots based on an attention mechanism, characterized in that: Includes the following steps: S1. Receive remote sensing images and perform preprocessing; S2. Construct and train the HAGNet model; The HAGNet model includes an encoder and a decoder. A bridging layer and a high- and low-frequency attention module are set between the encoder and the decoder to enhance the representation of deep features from the frequency domain perspective. The encoder, based on a ResNet encoder structure, is used to extract features from remote sensing images at different scales. The decoder recovers the feature resolution step by step through bottom-up multi-level decoding and filters out noise information in encoder skip connections through an attention gating mechanism. S3. Input the preprocessed image into the trained HAGNet model and output the farmland plot segmentation results.
2. The remote sensing farmland plot extraction method based on attention mechanism according to claim 1, characterized in that: In step S1, the preprocessing includes pixel normalization and channel normalization.
3. The remote sensing farmland plot extraction method based on attention mechanism according to claim 1, characterized in that: In step S2, the encoder consists of an input convolutional layer, a max pooling layer, and multiple depth residual modules. First, the input convolutional layer is used to extract shallow texture features: in, This is the preprocessed remote sensing image; Then max pooling is performed to obtain the downsampled feature map: Then, the results are obtained sequentially through multiple residual modules: Each residual element satisfies: in This represents a nonlinear transformation combining two convolutional layers and batch normalization.
4. The remote sensing farmland plot extraction method based on attention mechanism according to claim 3, characterized in that: In step S2, the bridging layer is used to transfer the deep features output by the encoder. Its semantic representation capability is enhanced by performing two consecutive convolutions: Features Rearranged as: ; High- and low-frequency attention modules include: (1) Low-frequency attention modeling of global semantics, as follows: For input features Perform a linear transformation: Downsampling is performed using average pooling: Calculate the key-value vector: Calculate attention: Obtain low-frequency attention output: (2) High-frequency attention extracts boundary details, as follows: Divide the features into local windows: Calculate self-attention within the window: Obtain high-frequency attention output: (3) Fusion of high and low frequency features Concatenate the two types of features: Restore convolution format: 。 5. The remote sensing farmland plot extraction method based on attention mechanism according to claim 4, characterized in that: In step S2, the decoder consists of multiple decoding layers, and each decoding layer includes: an upsampling unit, an attention gating unit, a feature splicing unit, and a dual convolutional fusion unit; (1) Upsampling unit The spatial dimensions of the features upsampled to the previous encoder stage using deconvolution or bilinear interpolation are denoted as: in, Indicates the first Level decoding layer, Indicates input to the first Features of the decoding layer Indicates an upsampling operation; when = hour, for That is, the output of the high and low frequency attention modules is limited to the "first-level" decoding layer; the others... These are the output features of the previous decoding layer. The number of levels in the decoding layer of the decoder; (2) Attention gating unit For the gated signal from the decoder shallow features of the encoder Map both to the same channel dimension: in, for Convolution, upsampling output As a gating signal ; Add the mapped features element by element: Use Sigmoid activation to generate attention weights: in, , for convolution; Filtering features: 。 (3) Feature splicing unit Upsampled output and filtered gated features splicing: (4) Dual convolutional fusion unit Then, the two convolutional structures are used for fusion: Each of them Include Convolution, batch normalization, and ReLU activation.
6. The remote sensing farmland plot extraction method based on attention mechanism according to claim 5, characterized in that: In step S3, the output of the HAGNet model For: the final output of the decoder pass Convolution performs class mapping: in, A segmented diagram representing farmland and the background.
7. The remote sensing farmland plot extraction method based on attention mechanism according to claim 6, characterized in that: The output results Softmax activation is used as the probability prediction, and a thresholding method is further used to convert the probability map into a binary mask as the final farmland plot segmentation result.
8. The remote sensing farmland plot extraction method based on attention mechanism according to claim 5, characterized in that: The bilinear interpolation performs size alignment specifically as follows: if Then execute: 。 9. The remote sensing farmland plot extraction method based on attention mechanism according to claim 1, characterized in that: The HAGNet model is trained using a composite loss function, which includes cross-entropy loss and Dice loss. The cross-entropy loss is: Dice's loss is: in, and The value range is 0.3–0.7.