Skip to Content
Remote SensingRemote Sensing
  • Article
  • Open Access

8 May 2026

25 Pages

A3UNet: A Lightweight Farmland Identification Network Integrating Local, Medium-Range, and Global Modeling

and
1
Faculty of Science, The University of Auckland, Auckland 1010, New Zealand
2
School of Earth Sciences and Engineering, Hohai University, Nanjing 211100, China
*
Author to whom correspondence should be addressed.
This article belongs to the Section AI Remote Sensing

Highlights

What are the main findings?
  • A lightweight segmentation network, A3UNet, is proposed for farmland identification in high-resolution remote sensing imagery by jointly integrating PLFA, MRA, and TGA into a three-stage encoder–decoder backbone to enhance fine-grained boundaries, medium-range spatial dependencies, and global semantic discrimination, respectively.
  • A3UNet achieves the best overall performance on both the GID and LoveDA datasets, while maintaining only 2.51 MB of parameters and 2.92 G FLOPs, demonstrating stable accuracy gains with extremely low model complexity.
What are the implications of the main findings?
  • The results indicate that the collaborative design of fine-grained boundary modeling, medium-range structural constraint, and global semantic modeling can more effectively recover farmland integrity, suppress false positives and false negatives, and alleviate class confusion in complex backgrounds.
  • This study provides a practical pathway for high-resolution farmland identification by balancing accuracy, robustness, and efficiency, and suggests that task-oriented hierarchical attention design can serve as an effective alternative to heavy global-modeling architectures.

Abstract

In high-resolution remote sensing imagery, farmland areas commonly exhibit blurred boundaries, discontinuous internal structures, and high similarity to non-farmland objects such as roads, bare soil, and low vegetation. Meanwhile, because pixel-level annotation is costly and training samples are difficult to obtain, only limited training data are often available in practical applications, making methods that rely on large-scale samples and complex model structures difficult to generalize effectively. To address these two issues, this paper proposes A3UNet, a multi-level attention-enhanced lightweight segmentation network for farmland identification from high-resolution remote sensing imagery. Based on a three-level encoder–decoder structure, the network introduces Point-Local Fusion Attention (PLFA), Medium-Range Attention (MRA), and Tri-Global Attention (TGA) into the skip connections, bottleneck layer, and intermediate decoder layer, respectively, thereby enhancing farmland feature representation from three levels: local boundaries, medium-range connected structures, and global semantic constraints. Few-sample experiments on two public datasets, GID and LoveDA, show that A3UNet achieves IoU values of 83.22% and 75.87%, respectively, with only 2.51 MB of parameters and 2.92 G FLOPs. Compared with the second-best methods on the corresponding datasets, the IoU is improved by 4.78 and 5.68 percentage points, respectively. These results indicate that the proposed method can achieve favorable identification accuracy and result stability while maintaining low model complexity, providing a lightweight solution with stronger practical application potential for farmland identification from high-resolution remote sensing imagery.

1. Introduction

Farmland is an important national foundational resource, and the rapid and accurate acquisition of its spatial distribution information is of great significance for ensuring food security and supporting territorial spatial planning [1]. With the rapid development of high-resolution remote sensing imagery, the spatial details of surface objects have been significantly enhanced, allowing farmland regions to present richer parcel textures, boundary morphologies, and spatial distribution characteristics in imagery [2]. However, while high-resolution imagery improves information representation, it also substantially increases the complexity of farmland identification [3]. On the one hand, differences in crop types, growth stages, and cultivation practices lead to significant spectral heterogeneity and texture diversity within farmland regions [4]. On the other hand, non-farmland objects such as roads, ditches, shelterbelts, shadows, and scattered built-up land are highly similar to farmland in local features, which easily causes class confusion [5].
In recent years, advances in deep learning have significantly promoted the development of farmland identification methods [6]. Early studies were primarily based on convolutional neural networks (CNNs), among which encoder–decoder architectures represented by U-Net effectively fused multi-scale detailed information with deep semantic information through skip connections [7], achieving promising performance in both medical imaging and remote sensing scenarios and thus being widely applied to farmland identification tasks. However, conventional CNNs are constrained by their local receptive fields and still exhibit certain limitations in modeling large-scale spatial dependencies and complex contextual relationships [8]. Subsequently, with the introduction of Transformer architectures, models became capable of capturing long-range dependencies over larger spatial ranges through self-attention mechanisms, thereby alleviating, to some extent, the insufficient global modeling capability of traditional CNNs [9]. On this basis, recent studies have gradually extended from pure convolutional networks to CNN–Transformer hybrid architectures and efficient decoding structures. For example, methods such as FT-UNetFormer [10], BANet [11], and DCSwin [12] have demonstrated strong performance in high-resolution remote sensing image segmentation tasks. Nevertheless, while Transformer-based methods enhance global modeling capability, they are often accompanied by large parameter scales and high computational complexity, making it difficult for them to fully realize their advantages in practical scenarios with limited annotated data or constrained computational resources [10,13].
Therefore, increasing attention has recently been directed toward lighter and more task-specific attention enhancement strategies [14,15,16]. Unlike approaches that improve feature representation by stacking deeper network layers or expanding channel width, these methods adaptively reweight critical features, enabling the model to focus more effectively on target-related regions and thereby achieve effective performance improvement with relatively small additional overhead. Existing studies have shown that attention mechanisms offer clear advantages in remote sensing image segmentation for recovering boundary details, enhancing responses in key regions, and strengthening contextual semantic modeling. For instance, the method proposed by Li et al. alleviated the problem of blurred parcel boundaries in high-resolution imagery by integrating a boundary-aware mechanism [17]. The FADConv proposed by Shu et al. improved the discrimination between farmland and non-farmland through frequency-domain attention and dynamic weight allocation [18]. Xu et al. enhanced parcel integrity and boundary representation by introducing a multi-scale global attention mechanism [19]. And the EMCAD proposed by Rahman et al. combined channel attention, spatial attention, and grouped gating mechanisms to improve multi-scale feature reconstruction while maintaining computational efficiency [15]. Overall, compared with directly relying on heavy global modeling architectures, lightweight attention enhancement mechanisms provide a feasible path for farmland identification in high-resolution remote sensing scenarios by balancing accuracy and efficiency.
However, when introducing attention mechanisms, existing methods still tend to rely on complete network structures and complex module stacking to improve the performance of the backbone model, making the resulting models larger in both parameter scale and computational complexity [4,20]. For farmland identification, annotation is costly and available samples are limited. Overly heavy model structures not only bring redundant computation but also increase the risk of overfitting [21]. Therefore, under the premise of fully exploiting the advantages of attention mechanisms without significantly increasing model complexity, how to effectively capture fine-grained boundary information and structural characteristics of farmland regions has become a key problem that urgently needs to be addressed in current farmland identification tasks [22].
This paper summarizes the problem into three interrelated subproblems with different modeling requirements. First, insufficient fine-grained boundary representation: in high-resolution remote sensing imagery, farmland boundaries are often disturbed by complex textures and similar objects such as roads and shelterbelts, resulting in blurred boundaries and missing details. Second, discontinuous regional structures: farmland usually presents obvious block-like distributions and spatial connectivity, but existing methods have limited capability in modeling mid-scale features and therefore tend to produce fragmented regions or internal inconsistency. Third, insufficient global semantic robustness: in high-resolution remote sensing imagery, farmland categories exhibit not only significant intra-class variation, such as texture and spectral changes caused by different crop types, growth stages, and cultivation practices, but also high local similarity to some non-farmland objects, such as bare land, grassland, and low-vegetation-covered areas, thereby leading to severe class confusion.
To this end, this paper proposes A3UNet (Fine-Medium-Global Attentive U-Net), a hierarchical attention-enhanced network for farmland identification from high-resolution remote sensing imagery based on “local boundary-medium-range structure-global semantics”, to simultaneously alleviate blurred farmland boundaries, regional fragmentation, and class confusion under complex backgrounds. Specifically, using U-Net as the backbone, the method starts from three levels: fine-grained texture and boundary modeling, medium-range spatial consistency modeling, and deep global semantic robustness modeling, and designs Point-Local Fusion Attention (PLFA), Medium-Range Attention (MRA), and Tri-Global Attention (TGA) modules, respectively. The PLFA module is used to adaptively select and strengthen fine-grained texture and boundary information in high-resolution features. The TGA module enhances the ability of deep features to model global contextual relationships, thereby improving semantic discrimination for easily confused objects. The MRA module explicitly models medium-range spatial dependencies and enhances the block-wise continuity and internal consistency of farmland areas. Compared with existing methods, the design focus of A3UNet is no longer to trade increased network depth or stacked complex modules for accuracy improvement. Instead, it hierarchically and collaboratively integrates local boundary enhancement, mid-level structural modeling, and deep semantic constraints around the specific needs of fine-grained farmland segmentation. Through this design, the model can more specifically alleviate boundary ambiguity, regional fragmentation, and class confusion in farmland identification while maintaining low parameter size and computational complexity.
In summary, the main contributions of this paper are as follows:
  • A lightweight hierarchical attention network, A3UNet, is proposed for fine-grained high-resolution farmland segmentation. The network maps boundary ambiguity, regional structural discontinuity, and complex-background class confusion in farmland identification to local boundary modeling, medium-range structural modeling, and global semantic modeling, respectively, forming a hierarchical feature enhancement framework with a clear task orientation.
  • To address complex agricultural textures and blurred boundaries, a PLFA module is designed and used to enhance high-resolution features in skip connections, improving the effectiveness of local boundary and fine-grained texture information transmission.
  • To address the discontinuity of the internal structure of farmland regions, an MRA module is designed to enhance the connectivity and internal consistency of farmland patches through medium-range spatial dependency modeling.
  • To address class confusion caused by similar objects such as bare soil, low vegetation, and roads, a TGA module is designed to introduce global semantic constraints at the bottleneck layer, thereby improving the discriminative stability of deep features.

2. Material and Methods

2.1. Overall Architecture

To address the common problems of blurred boundaries, discontinuous regional structures, and class confusion in farmland areas of high-resolution remote sensing imagery, this paper constructs a multi-level attention-enhanced network, A3UNet, whose overall structure is shown in Figure 1. Unlike existing methods that often deepen the backbone network, introduce complex decoders, or stack general attention modules, the core design of A3UNet is not to simply add multiple independent modules to U-Net. Instead, it establishes a hierarchical modeling mechanism of “local boundary-medium-range structure-global semantics” around the farmland identification task. This mechanism maps the three key challenges in farmland identification to different feature positions within the network: the encoding stage, the bottleneck layer, and the decoding stage.
Figure 1. Network architecture of Fine-Medium-Global Attentive U-Net (A3UNet) (where the white and black areas in the rightmost image represent the target and background, respectively).
Specifically, the input remote sensing image is first passed through the encoder to progressively extract multi-scale features. In the three encoding stages, each level of encoded features is first enhanced by PLFA for local boundary and fine-grained texture enhancement. The enhanced features are then used as skip-connection inputs to the decoder and also participate in the subsequent downsampling encoding process. Different from the direct transfer of local features in a standard U-Net, PLFA prevents skip connections from indiscriminately transferring spatial details; instead, it selects and strengthens features related to farmland boundaries and local discrimination.
At the deepest bottleneck position, features are first globally enhanced by TGA to alleviate class confusion caused by similar objects such as bare soil, low vegetation, and roads. The features are then passed through MRA to model medium-range spatial dependencies and improve the ability of deep features to represent the connected structure of farmland patches. In the decoding stage, spatial resolution is restored through progressive upsampling and fusion with corresponding skip features. Here, MRA in the decoder is not repeatedly used at every decoder level, but is deployed only at the intermediate decoding stage to structurally correct features that have already fused partial local details and deep semantics, thereby reducing regional fragmentation and boundary discontinuity that may occur during upsampling. Finally, the network outputs the farmland identification result through a 1 × 1 convolution.

2.2. Backbone Network

2.2.1. Basic Convolution Unit

The basic convolution unit of the network consists of two consecutive 3 × 3 convolutions, each followed by normalization and ReLU activation, as follows:
H(X) = δ(N(W2 * δ(N(W1 * X))))
where H(·) denotes a DoubleConv, * denotes convolution, N(·) denotes normalization, and δ(·) denotes ReLU.
Furthermore, the downsampling at each encoder stage consists of MaxPool and DoubleConv, whereas the decoder performs bilinear-interpolation-based upsampling concatenates the result with the corresponding skip features, and then applies DoubleConv for feature fusion. To accommodate the small-batch training scenario in farmland segmentation, GroupNorm is adopted for normalization.

2.2.2. Forward Propagation of A3UNet

Let the outputs of the three encoder stages be x1, x2, and x3, the bottleneck feature be x4, and the PLFA-enhanced skip features be s1, s2, and s3, respectively.
It should be noted that the insertion positions of the three attention modules in A3UNet are not uniformly allocated layer by layer according to network depth, but are deployed according to the correspondence between their functions and the problems in farmland identification. PLFA acts on the skip-connection features of the three encoding stages; TGA acts only on the deepest bottleneck feature; and MRA acts on both the bottleneck feature after TGA and the intermediate decoder feature. Thus, the network can perform local-detail selection, global semantic constraint, and medium-range structural correction at different spatial scales.
The forward pseudo-code of the network is as follows (as shown in Algorithm 1):
Algorithm 1 A3UNet
Input: Remote sensing image X
Output: Segmentation logits Y
1  x1 ← DoubleConv(X)
2  s1 ← PLFA_1(x1)
3  x2 ← Down(s1)
4  s2 ← PLFA_2(x2)
5  x3 ← Down(s2)
6  s3 ← PLFA_3(x3)
7  x4 ← Down(s3)
8  x4 ← TGA(x4)
9  if use_mra_bottleneck then
10  x4 ← MRA_bottleneck(x4)
11  end if
12  d3 ← Up(x4, s3)
13  d2 ← Up(d3, s2)
14  if use_mra_mid_decoder then
15  d2 ← MRA_mid(d2)
16  end if
17  d1 ← Up(d2, s1)
18  Y  ← Conv1x1(d1)
19  return Y

2.3. Point–Local Fusion Attention (PLFA)

In high-resolution remote sensing farmland identification, local features usually contain rich edge, texture, and local structural information, which is important for accurately recovering farmland contours, distinguishing parcel boundaries, and separating farmland from adjacent easily confused objects. However, local features in complex agricultural scenes are often mixed with large amounts of irrelevant texture interference, such as roads, field ridges, bare soil, shadows, and scattered vegetation. As a result, local features extracted by traditional convolution are likely to transfer useful details and noise information together to the decoder through skip connections, causing boundary ambiguity, local misclassification, and loss of fine-grained structures. Therefore, this paper designs a Point-Local Fusion Attention (PLFA) module to adaptively recalibrate local features and enhance discriminative detail representation related to farmland targets. The module structure is shown in Figure 2.
Figure 2. Structure of the Point-Local Fusion Attention (PLFA) module.
In A3UNet, PLFA is deployed at the three encoder stages to locally enhance skip-connection features at different scales. Specifically, at stages with higher feature-map resolution, PLFA mainly highlights farmland edges, parcel details, and local texture differences. At deeper encoding stages, PLFA further selects feature responses with local structural significance and reduces the interference of complex background textures on subsequent semantic fusion. This module combines pixel-wise channel-response modeling with local spatial-neighborhood modeling, enabling the model to selectively strengthen features related to farmland boundaries, local textures, and regional discrimination while maintaining the current feature resolution.
Specifically, the module first uses Point Attention (PA) to model inter-channel interactions at each pixel location, thereby adaptively recalibrating channel responses at different spatial positions and highlighting feature channels that are more sensitive to farmland boundary and texture discrimination. Second, Local Attention (LA) is used to model texture context within local spatial neighborhoods, enhancing the local structural consistency of farmland regions and suppressing interference caused by complex background textures. Finally, learnable weights are introduced to adaptively fuse the two types of attention responses, and a residual gating mechanism is used to modulate features element by element, thereby achieving selective enhancement while preserving the transmission of original feature information. Therefore, PLFA unifies pixel-wise channel modeling and local spatial modeling within a single framework. The formulation is as follows:
(1)
PA: For the input feature X ∈ R B × C × H × W (where B denotes the batch size, C denotes the number of channels, and H and W denote the spatial size of the feature), PA does not perform global pooling, but instead establishes point-wise channel interactions at each spatial location through two 1 × 1 convolutions. Its gating weights are defined as follows:
G p = σ W p 2 ∗ δ N W p 1 ∗ X
Different from conventional channel attention that relies on global average pooling, this branch preserves the full spatial resolution and can therefore modulate channel responses differently at different positions. Here, X denotes the input feature map, W p 1 and W p 2 denote the two 1 × 1 convolution kernels for channel reduction and restoration, respectively, N ⋅ denotes normalization, δ ⋅ denotes the nonlinear activation function (ReLU), σ ⋅ denotes the Sigmoid function, and ∗ denotes convolution. The resulting G p is a per-pixel channel attention weight map.
(2)
LA: To compensate for the insufficient perception of local neighborhoods in point-wise channel modeling, PLFA further introduces LA. This attention branch first uses a depthwise separable 3 × 3 convolution to extract local textures and then performs channel mixing through a 1 × 1 convolution. The computation can be written as follows:
G l = σ δ N W l , p w ∗ W l , d w ∗ X
where W l , d w denotes the 3 × 3 convolution kernel, W l , p w denotes the 1 × 1 convolution kernel, and N ⋅ , δ ⋅ , and σ ⋅ are the same as those in PA. This branch introduces a local receptive field at low cost and is used to enhance the model’s ability to capture local neighborhood features such as farmland boundaries and fragmented textures.
(3)
Output: After obtaining the two attention weight maps, this study further uses two learnable scalars, α and β, to perform weighted fusion:
G = σ α G p + β G l
The final output adopts a residual gating form:
Y = X + X ⨂ G
where ⨂ denotes element-wise multiplication, and Y denotes the output of the PLFA module. In summary, this module effectively preserves the backbone information of the original features and avoids information truncation caused by overly strong attention features. Meanwhile, it enables the model to strengthen, at low cost, the fine-grained features that truly contribute to boundary restoration.
In summary, PLFA acts on the output features of the three encoder stages, allowing skip connections at different scales to effectively complete local discriminative recalibration before entering the decoder. Different from channel attention that relies on global pooling, PA in this module adaptively adjusts channel responses at different spatial positions while preserving the spatial resolution of the current feature map. Different from pure local convolution, LA supplements neighborhood texture context information and enhances the model’s ability to represent farmland boundaries, local textures, and fine structures. After the two branches are fused, PLFA can reduce the influence of irrelevant background textures being directly passed into the decoder to a certain extent, so that skip connections are no longer simple transfers of encoder details, but become multi-scale feature enhancement channels for local farmland discrimination and boundary recovery.

2.4. Medium-Range Attention (MRA)

Although PLFA can effectively enhance farmland boundaries, local textures, and fine-grained discriminative information, its modeling range is mainly concentrated on pixel-wise channel interactions and local-neighborhood texture context. In high-resolution remote sensing farmland identification, farmland targets are not composed of isolated pixels but appear as contiguous regions with a certain scale. Studies [4,23] show that even when local boundary information has been effectively enhanced by the model, the final segmentation results may still suffer from internal regional discontinuity and incomplete block-like structures.
To this end, this paper further proposes a Medium-Range Attention (MRA) module to compensate for the deficiency of PLFA in medium-scale contextual modeling. Its structure is shown in Figure 3. First, multi-scale pooling fusion is used to obtain medium-resolution features with stable contextual perception. Second, rectangular depthwise convolutions are used to model medium-range spatial relationships along the horizontal and vertical directions, respectively. Finally, the generated medium-scale attention response is restored to the original resolution and used to enhance the input feature through residual gating. In this way, a lightweight spatial attention module oriented to a medium receptive field is obtained, specifically complementing the scale gap between local modeling and deep global modeling.
Figure 3. Structure of the Medium-Range Attention (MRA) module.
Let the input feature be X ∈ R B × C × H × W . For each pooling scale s ∈ S, adaptive average pooling is first performed as follows:
H s = m a x ⌊ H s ⌋ , 1 ,     W s = m a x ⌊ W s ⌋ , 1
X s = A A P X ; H s , W s
where ⌊ ⋅ ⌋ denotes the floor operation, H s and W s denote the downsampled sizes, and m a x ⋅ , 1 prevents the size from becoming zero. A A P denotes adaptive average pooling. The pooled results at all scales are then interpolated to the unified reference scale ( H r , W r ):
X ~ s = I n t e r p X s ; H r , W r
where I n t e r p denotes bilinear interpolation. After alignment, the multi-scale features are concatenated along the channel dimension and then fused through a 1 × 1 convolution:
U = C o n c a t { X ~ s } s ∈ S ∈ R B × S C × H r × W r
F = δ N W f ∗ U
where C o n c a t denotes concatenation along the channel dimension, N ⋅ denotes normalization, δ ⋅ denotes the nonlinear activation function (ReLU), W f denotes the 1 × 1 convolution weight, and ∗ denotes convolution. At this stage, information from different receptive fields is aggregated at a lower resolution to reduce the disturbance of local noise and enhance stable representation of parcel structures.
Furthermore, after obtaining the fused feature F , MRA does not adopt a computationally expensive standard large convolution kernel. Instead, it sequentially uses rectangular depthwise convolutions of 1 × k and k × 1 to explicitly model horizontal and vertical medium-range dependencies:
F h = D W C o n v 1 × k F
F v = D W C o n v k × 1 F h
M = δ N W m ∗ F v
where D W C o n v denotes depthwise separable convolution. Compared with directly using a k × k convolution, rectangular convolution decomposes a two-dimensional large kernel into two one-dimensional propagation processes, which significantly reduces computation while strengthening directional medium-range structural modeling, making it more suitable for block-connected farmland regions.
Finally, the module uses a 1 × 1 convolution to generate a gating map and upsamples it back to the input resolution:
G = σ I n t e r p W g ∗ M ; H , W
where W g denotes the 1 × 1 convolution weight. The final output of MRA is given by Y , where ⨂ denotes element-wise multiplication:
Y = X + X ⨂ G
In summary, as shown in Equations (6)–(15), the MRA module does not directly replace the original features, but instead performs mid-scale structural correction in a residual gating manner. When deployed at the bottleneck layer, it helps learn stable regional layouts. When deployed at the intermediate decoder layer, it can further constrain the structural restoration process after upsampling.
In summary, the role of MRA is not simply to enlarge the receptive field, but to further introduce medium-range spatial structural constraints after PLFA provides local boundary and texture enhancement. It should be noted that MRA is not repeatedly stacked in all decoder layers. Instead, according to the need for farmland patch structure recovery, it is deployed only at two key positions: the bottleneck layer and the intermediate decoder layer. The former is used to learn a more stable regional layout and connectivity relationship, while the latter is used to constrain structural recovery during upsampling, thereby reducing regional fragmentation and boundary discontinuity. Through this dual-position but non-layer-by-layer deployment strategy, MRA can enhance the block-wise continuity and internal consistency of farmland regions at a low computational cost.

2.5. Tri-Global Attention Module (TGA)

Although PLFA and MRA improve feature representation from the perspectives of local boundary enhancement and medium-scale structural modeling, their modeling ranges are still mainly limited to local neighborhoods and medium-distance spatial dependencies, making it difficult to establish stable global semantic constraints. In high-resolution remote sensing imagery, the appearance of farmland areas often varies significantly with location, and parcel color, texture morphology, and arrangement direction differ markedly in urban-rural transition areas. Without global contextual constraints, the model tends to rely more on locally similar features for discrimination, which may cause woodland, bare soil, or grassland to be misidentified as farmland. Therefore, it is necessary to introduce a global modeling mechanism at a higher semantic level to improve the model’s discriminative ability under complex backgrounds.
Accordingly, this paper proposes a Tri-Global Attention (TGA) module to globally enhance deep features at the network bottleneck. Its structure is shown in Figure 4. Different from a single form of global attention, TGA collaboratively models different types of global information through three complementary branches: TGA-1 extracts global responses that preserve spatial structure through a cross-scale pooling-upsampling mechanism; TGA-2 models stable global channel statistics through normalization and global pooling; and TGA-3 directly captures global dependencies between arbitrarily distant positions using standard multi-head self-attention (the multi-head self-attention branch uses 4 attention heads). Finally, the three global representations are linearly combined with learnable weights and applied to the input features in a residual form, thereby forming a comprehensive enhancement of deep semantic representations.
Figure 4. Structure of the Tri-Global Attention (TGA) module.
Specifically, the TGA-1 branch adopts a pooling-projection-upsampling manner to extract cross-scale spatial priors at compressed resolution. Adaptive average pooling is applied to the input X at a ratio of r p :
X p = A A P X ; H r p , W r p
where A A P denotes adaptive average pooling, and H and W denote the height and width of the input feature map, respectively. Subsequently, a 1 × 1 convolution is used for mapping and the result is restored to the original resolution to obtain the spatial gating map:
G 1 = σ I n t e r p W 1 ∗ X p ; H , W
Y 1 = X ⨂ G 1
where W 1 denotes the weight parameter of a 1 × 1 convolution kernel, I n t e r p denotes interpolation-based upsampling, ∗ denotes convolution, σ denotes the Sigmoid function, and ⨂ denotes element-wise multiplication.
The TGA-2 branch is designed for channel semantic recalibration. It first normalizes the input feature and then compresses the spatial dimensions through global average pooling:
X ‾ = N X ,     z = G A P X ‾ ∈ R B × C × 1 × 1
where N ⋅ denotes normalization and G A P ⋅ denotes global average pooling (GAP). Then, a bottleneck MLP composed of two 1 × 1 convolutions is used to generate channel gating:
G 2 = σ W 22 ∗ δ W 21 ∗ z
Y 2 = X ⨂ G 2
where W 21 denotes the weight parameter of the first 1 × 1 convolution, which compresses the number of channels to a lower dimension, and W 22 denotes the weight parameter of the second 1 × 1 convolution, which maps the compressed feature back to the original channel dimension.
The TGA-3 branch is used to explicitly model long-range dependencies. First, the two-dimensional feature map is flattened into a token sequence:
T ∈ R B × N × C ,     N = H × W
where N denotes the total number of tokens and T denotes the token sequence. After LayerNorm, queries, keys, and values are constructed:
Q = T W q ,     K = T W k ,     V = T W v
where W q , W k , and W v denote the linear projection weight matrices used to generate Q , K , and V , respectively.
Furthermore, the global correlation matrix is computed through multi-head self-attention as follows:
A = S o f t m a x Q K ⊤ d
where d denotes the feature dimension of each attention head, which is used to prevent the dot-product result from becoming excessively large as the feature dimension increases, thereby improving the stability of Softmax computation. Under the default bottleneck channel number C, the feature dimension corresponding to each attention head is d = C/4.
This correlation matrix is used to perform weighted aggregation of the value vectors:
A t t n = A V
After a linear mapping, the result is restored to a two-dimensional feature map:
Y 3 = R e s h a p e P r o j A t t n
where P r o j denotes the linear mapping layer used to remap the multi-head attention output to the target feature dimension, and R e s h a p e denotes the rearrangement operation used to restore the sequence-form feature to a two-dimensional feature map.
The outputs of the three branches are weighted by learnable coefficients and fused with the original feature in a residual form:
Y = X + w 1 Y 1 + w 2 Y 2 + w 3 Y 3
Since TGA is deployed at the bottleneck layer, the feature resolution has already been significantly reduced at this stage, thereby effectively controlling the computational overhead of multi-head self-attention.
In summary, TGA forms unified global semantic constraints in the deep feature space through cross-scale spatial modeling, channel semantic recalibration, and explicit long-range dependency modeling. Unlike a single global attention mechanism, TGA simultaneously focuses on spatial layout, channel semantics, and long-range dependencies, making it suitable for handling semantic confusion between farmland and similar backgrounds such as bare soil, grassland, and low vegetation. Meanwhile, because TGA is deployed only at the bottleneck layer, its computational overhead is effectively controlled, enabling A3UNet to obtain more stable global discriminative capability while maintaining a lightweight design.
Through the above design, A3UNet establishes a clear correspondence among task problems, feature levels, and module positions. PLFA acts on the three encoder skip connections and mainly addresses the mixed transfer of multi-scale local boundary information, texture details, and background interference on the encoder side. TGA acts on the deepest bottleneck feature and mainly addresses insufficient global semantic constraints and class confusion under complex backgrounds. MRA acts on the bottleneck layer after TGA and on the intermediate decoder layer, mainly addressing discontinuous farmland structures and insufficient block-wise connectivity. Thus, the proposed method realizes hierarchical feature enhancement for high-resolution farmland identification within a lightweight encoder–decoder backbone.

2.6. Dataset Construction

This paper uses two public remote sensing semantic segmentation datasets for experimental validation, namely GID (Gaofen Image Dataset) and LoveDA (Land-cOVEr Domain Adaptive semantic segmentation), as shown in Figure 5. Both datasets are derived from high-resolution remote sensing imagery and contain rich land-cover categories and complex spatial structures. They have been widely used in land-cover classification and semantic segmentation research.
Figure 5. Visual examples of training samples from the GID (left) and LoveDA (right) datasets (in the annotation masks, white pixels indicate farmland regions, while black pixels indicate background regions).
The GID dataset is constructed based on Gaofen-2 (GF-2) satellite imagery and covers multiple typical regions in China, with significant spatial distribution differences and diverse land-cover types. The dataset is mainly composed of urban areas, and each image contains multiple categories such as buildings, farmland, woodland, and water bodies. It also exhibits obvious scale variations and texture differences across different regions, enabling effective evaluation of model identification ability in complex scenes.
The LoveDA dataset is mainly designed for cross-domain land-cover segmentation tasks and contains two typical scenarios: urban and rural. Compared with GID, this dataset exhibits significant inter-domain differences. Its rural regions are dominated by farmland and present relatively regular block-like distributions, whereas the urban regions have more complex spatial structures. The two scene types differ significantly in texture distribution and spatial patterns, making the dataset suitable for evaluating farmland identification capability under urban or rural backgrounds.
For data selection, this paper constructs datasets from urban scenes in GID and rural scenes in LoveDA, and names them GID and LoveDA, respectively. In the preprocessing stage, considering the large size of high-resolution images in GID, a sliding-window cropping strategy is adopted to construct training samples. Specifically, ten farmland regions with different characteristics are cropped from the original images as the prediction set, and the remaining areas are uniformly cropped into 256 × 256 image patches and synchronously processed with the corresponding labels to form pixel-wise aligned data pairs. Meanwhile, rotation, flipping, and noise perturbation are introduced as data augmentation operations on the GID dataset to improve the model’s adaptability to different spatial structures and texture variations, expanding the dataset to 5000 sample pairs.
For the LoveDA dataset, because the rural scene contains sufficient samples, ten farmland regions with different characteristics are directly selected as the prediction set. The remaining regions are cropped until 5000 samples of size 256 × 256 are obtained. Based on the above processing, training and testing data suitable for high-resolution farmland identification are finally formed, and the split ratio between the training set and the test set is set to 9:1 with reference to Study [4]. The scene backgrounds and farmland morphological characteristics of the prediction areas are shown in Table 1.
Table 1. Scene backgrounds and farmland morphological characteristics of the GID and LoveDA prediction areas.
It should be noted that, because pixel-level annotation of high-resolution remote sensing imagery is costly and time-consuming, only a limited number of manually labeled samples can usually be obtained in practical applications. Accordingly, this paper constructs a few-shot training set using cropped local samples so as to more realistically simulate practical farmland identification scenarios.

3. Experimental Results and Analysis

3.1. Experimental Platform and Accuracy Evaluation Settings

All experiments are implemented based on PyTorch v2.4.0 and trained on a single NVIDIA 4060-16G GPU. During training, the batch size is set to 8, the number of epochs is 1000, and the initial learning rate is set to 1 × 10−4. In terms of loss-function settings, this paper adopts the pixel-wise cross-entropy loss (Cross-Entropy Loss, CE Loss); that is, the same loss calculation method is used during both training and validation, and the validation loss is used as an important basis for judging model convergence and saving the best weights. In terms of evaluation metrics, Overall Accuracy (OA), Precision, Recall, F1-score, Intersection over Union (IoU), and the Kappa coefficient are used to evaluate model performance, and the results are statistically reported in the form of “mean ± standard deviation”. The corresponding results are presented in the comparison and ablation experiment tables.
In addition to conventional region-overlap metrics, Section 3.3 further introduces Boundary Precision as a boundary-specific evaluation metric to supplement the assessment of each module’s ability to delineate farmland boundaries. This metric measures the proportion of predicted boundaries that can match the ground-truth boundaries within a given pixel tolerance, reflecting the accuracy and reliability of predicted boundaries.
It should be noted that the accuracies of the models in the evaluation tables of this section are reported in the form of “mean ± std”, calculated from the region-level evaluation results of the selected 10 independent prediction areas. Specifically, F1, IoU, Kappa, and other metrics are first calculated separately for each prediction area, and the mean and standard deviation are then computed over the 10 prediction areas. Therefore, the standard deviations in this paper mainly reflect inter-region performance fluctuations under different test regions, land-cover backgrounds, and farmland morphological characteristics.

3.2. Comparison Experiments

To comprehensively validate the effectiveness and generalization capability of the proposed A3UNet, six representative remote sensing semantic segmentation models were selected as comparison methods, including the classic encoder–decoder architecture U-Net [7], the high-resolution feature-preserving network HRNet [24], the attention-enhanced model BANet [11], the CNN-Transformer hybrid architecture FT-UNetFormer [10], the Swin Transformer-based DCSwin [12], and EMCAD [15], which performs well in few-shot scenarios. These methods cover the mainstream model paradigms in current remote sensing segmentation research, including CNN baselines, high-resolution branch architectures, attention-enhanced models, and CNN-Transformer hybrid architectures, and therefore are representative and valuable for comparison.
GID dataset: As shown in Table 2, A3UNet achieves the best results in all evaluation metrics, with OA, Precision, Recall, F1, IoU, and Kappa reaching 90.92%, 90.94%, 91.04%, 90.77%, 83.22%, and 81.60%, respectively. Compared with the second-best method, HRNet, the corresponding improvements are 2.83, 3.07, 4.78, and 6.13 percentage points. Notably, the standard deviations of OA, F1, IoU, and Kappa of A3UNet on this dataset are ±2.44, ±2.53, ±4.24, and ±4.98, respectively, all of which are significantly lower than those of the comparison methods, indicating that the model performs more stably across different test samples.
Table 2. Classification accuracy evaluation of different segmentation methods on the GID dataset (the values in red indicate the highest value for each metric; the results are the mean and standard deviation of the evaluation metrics over ten prediction regions).
Overall, A3UNet not only achieves superior overall accuracy, but also performs prominently on metrics such as IoU and Kappa that reflect regional overlap quality and category consistency, indicating that it has stronger capability in restoring the completeness of farmland regions and suppressing misclassification. As shown in Figure 6, A3UNet can more completely recover the morphology of farmland regions in most samples. In areas with elongated parcels, tortuous boundaries, and nearby interfering targets, A3UNet maintains good structural continuity and regional consistency while significantly reducing false positives and false negatives.
Figure 6. Comparison results on the GID dataset (white regions indicate farmland areas, black regions indicate background areas, green regions indicate misclassified areas, red regions indicate missed areas, and blue solid boxes indicate typical error regions).
LoveDA dataset: As shown in Table 3, A3UNet still maintains the best performance, with OA, Precision, Recall, F1, IoU, and Kappa reaching 88.63%, 86.05%, 86.30%, 85.67%, 75.87%, and 71.51%, respectively. Compared with the second-best method, U-Net, A3UNet improves OA, F1, IoU, and Kappa by 3.81, 3.92, 5.68, and 7.78 percentage points, respectively. This indicates that A3UNet has better generalization stability in rural scenarios with stronger cross-scene differences.
Table 3. Classification accuracy evaluation of different segmentation methods on the LoveDA dataset (the values in red indicate the highest value for each metric; the results are the mean and standard deviation of the evaluation metrics over ten prediction regions).
As shown in Figure 7, compared with the GID dataset, farmland regions in LoveDA are more complex in texture, shape, and spatial distribution, and are also more similar in local features to roads, bare soil, and low-vegetation regions, thereby more easily causing class confusion. Under such conditions, A3UNet can still recover farmland morphology relatively completely in most samples. Especially in regions with complex backgrounds, it suppresses non-farmland targets more effectively and significantly reduces large-area misclassification.
Figure 7. Comparison results on the LoveDA dataset (white regions indicate farmland areas, black regions indicate background areas, green regions indicate misclassified areas, red regions indicate missed areas, and blue solid boxes indicate typical error regions).
The above results indicate that the collaborative effect of PLFA, MRA, and TGA can strengthen feature representation at different scales, thereby improving overall recognition accuracy while alleviating performance fluctuations caused by texture differences, parcel arrangement changes, and background interference.
As shown in Table 4, in terms of model cost, A3UNet has only 2.51 MB of parameters and 2.92 G FLOPs, both of which are the lowest among all comparison methods. Compared with U-Net, A3UNet reduces the parameter size by approximately 95.06% and FLOPs by approximately 76.03%. Compared with EMCAD, the parameter size is reduced by approximately 97.54% and FLOPs by approximately 47.86%. Compared with FT-UNetFormer and DCSwin, the parameter size is reduced by approximately 99.31% and 99.45%, and FLOPs are reduced by approximately 91.63% and 91.53%, respectively. Further combining Table 1 and Table 2 shows that A3UNet achieves more effective farmland feature enhancement at a lower cost through a hierarchical attention design that better matches the task characteristics.
Table 4. Model complexity and efficiency analysis.
Furthermore, to avoid the one-sidedness that may arise from evaluating lightweight models only by parameter size and FLOPs, this paper additionally records the average inference time per image for each model under the same hardware environment, with the input image size uniformly set to 256 × 256 pixels. The results show that the inference time of A3UNet is 67.26 ± 0.76 ms/image, slightly higher than that of the simplest U-Net structure (64.69 ± 0.78 ms/image), but clearly lower than that of HRNet (93.68 ± 2.71 ms/image), BANet (71.02 ± 0.33 ms/image), FT-UNetFormer (84.76 ± 1.32 ms/image), DCSwin (83.38 ± 0.48 ms/image), and EMCAD (77.69 ± 0.74 ms/image). This shows that after introducing attention modules such as PLFA, MRA, and TGA, A3UNet does not incur an obvious inference burden. Its actual inference efficiency remains close to that of traditional lightweight encoder–decoder structures and is superior to most complex remote sensing segmentation models.
Combining Table 2, Table 3 and Table 4, it can be seen that A3UNet achieves the best farmland identification accuracy while maintaining the lowest parameter size and the lowest FLOPs, and it also maintains a relatively fast practical inference speed. Therefore, the lightweight advantage of A3UNet is not mainly reflected in model compression along a single dimension, but in the comprehensive balance among small model scale, low computational cost, fast inference speed, and high identification accuracy.

3.3. Ablation Experiments

To further validate the independent contributions and collaborative effects of each module, this paper designs eight groups of ablation experiments on a unified backbone network: No. 1 is the baseline model, No. 2–No. 4 correspond to introducing PLFA, MRA, and TGA individually, No. 5–No. 7 represent pairwise combinations, and No. 8 is the complete model A3UNet integrating all three modules.
In addition to conventional region-overlap metrics, this paper further introduces Boundary Precision (%) as a boundary-specific evaluation metric to supplement the assessment of the model’s ability to delineate farmland boundaries. Specifically, binary boundaries are first extracted from the prediction results and ground-truth labels, and then the matching between predicted boundaries and ground-truth boundaries is counted within a given pixel tolerance. Boundary Precision can be expressed as:
B P = B p ∩ D t ( B g ) B p × 100 %
where B p denotes the set of predicted boundary pixels, B g denotes the set of ground-truth boundary pixels, D t ( B g ) denotes the dilated boundary region centered on the ground-truth boundary with a tolerance of t pixels (where t = 2 pixels). This metric measures what proportion of the predicted boundary can match the ground-truth boundary, and therefore focuses more on the accuracy and reliability of the predicted boundary. Compared with region metrics such as OA, F1, and IoU, Boundary Precision does not directly evaluate the regional overlap of the whole image, but focuses on false boundary responses near boundary locations, enabling a more targeted analysis of whether the model reduces erroneous boundaries caused by similar objects such as roads, bare soil, and low vegetation.
The ablation results on the GID dataset are shown in Table 5. The OA, F1, IoU, and Kappa of the base model No. 1 are 85.21%, 85.29%, 75.09%, and 69.84%, respectively, and the Boundary Precision is 47.34%. On this basis, after PLFA is introduced alone, F1 and IoU increase to 86.92% and 77.27%, respectively, and Boundary Precision also increases from 47.34% to 48.06%. This indicates that the enhancement of local boundaries and fine-grained textures by PLFA can improve the response of the base model to farmland edges, but the improvement is relatively limited when broader structural constraints are absent. In other words, on the GID dataset, PLFA is more suitable as a supplementary module for local boundary information rather than independently undertaking complete regional structure modeling.
Table 5. Accuracy evaluation of the ablation experiments on the GID dataset (the values in red indicate the highest value for each metric; the results are the mean and standard deviation of the evaluation metrics over ten prediction regions).
After MRA is introduced alone, Recall increases to 92.36%, F1 and IoU reach 87.41% and 78.06%, respectively, and Boundary Precision further increases to 49.77%. This result indicates that medium-range spatial dependency modeling helps recover more complete contiguous farmland regions and can also improve the reliability of boundary prediction to a certain extent. From the recognition results in Figure 8, unlike PLFA, which mainly focuses on local textures and boundary details, MRA places more emphasis on the internal spatial associations of farmland regions and therefore plays a positive role in reducing regional fragmentation and boundary discontinuity. After TGA is introduced alone, Precision increases significantly to 93.00%, and Boundary Precision also increases to 49.26%, indicating that global semantic constraints help suppress erroneous responses in non-farmland regions and thus improve the accuracy of predicted boundaries. However, when TGA is used alone, Recall decreases to 80.38%, indicating that overly strong global discriminative constraints may make the model tend toward conservative prediction, leading to missed detection of some true farmland regions.
Figure 8. Ablation experiment results on the GID dataset (white regions indicate farmland areas, black regions indicate background areas, green regions indicate misclassified areas, red regions indicate missed areas, and blue solid boxes indicate typical error regions).
From the pairwise-combination results, PLFA+MRA, PLFA+TGA, and MRA+TGA all clearly outperform the base model, indicating strong complementarity among the three modules. In particular, the Boundary Precision of No. 5 (PLFA+MRA) and No. 6 (PLFA+TGA) reaches 58.20% and 57.04%, respectively, which is a marked improvement over using PLFA alone. This indicates that the local boundary cues provided by PLFA can be more effectively transformed into reliable boundary predictions when combined with medium-range structural modeling or global semantic constraints. No. 7 (MRA+TGA) shows particularly outstanding overall performance on the GID dataset, with OA, F1, IoU, and Kappa reaching 90.47%, 90.09%, 82.18%, and 80.66%, respectively, and Boundary Precision increasing to 60.33%. This indicates that medium-scale structural constraints and global semantic modeling have good complementarity: MRA helps maintain the continuity of block-like farmland structures, while TGA helps reduce misclassification in complex backgrounds. Their combination can simultaneously improve regional integrity and boundary reliability.
On this basis, the complete model No. 8 further achieves the best results, with OA, F1, IoU, and Kappa reaching 90.92%, 90.62%, 83.04%, and 81.60%, respectively, improving by 5.71, 5.33, 7.95, and 11.76 percentage points over the base model. Meanwhile, the Boundary Precision of No. 8 reaches 65.33%, the highest among all ablation settings, representing an improvement of 17.99 percentage points over the base model. This result demonstrates that when PLFA, MRA, and TGA act simultaneously, they not only improve the overall overlap accuracy of farmland regions but also significantly improve the matching degree between predicted boundaries and ground-truth boundaries. Combined with Figure 8, the complete model has fewer misidentified and missed regions along elongated parcel edges, tortuous boundaries, and areas adjacent to similar objects. The typical error regions marked by blue solid boxes further show that the three modules, when working collaboratively, can better balance local boundary details, regional connectivity, and semantic discrimination, thereby obtaining more complete and stable farmland identification results.
The background conditions of the LoveDA dataset are more complex, and its ablation results better reflect the different roles of the modules in rural agricultural scenes. As shown in Table 6, the OA, F1, IoU, and Kappa of the base model No. 1 are 78.78%, 79.15%, 66.11%, and 54.10%, respectively, and Boundary Precision is only 11.50%. This indicates that in the LoveDA rural scenario, although the base model can identify some farmland regions, its ability to distinguish boundaries between farmland and similar backgrounds such as bare soil, low vegetation, and rural roads is weak, and many unreliable responses appear in the predicted boundaries.
Table 6. Accuracy evaluation of the ablation experiments on the LoveDA dataset (the values in red indicate the highest value for each metric; the results are the mean and standard deviation of the evaluation metrics over ten prediction regions).
After PLFA is introduced alone, Recall increases from 74.94% to 86.65%, F1 and IoU increase to 83.53% and 72.65%, respectively, and Boundary Precision increases from 11.50% to 14.09%. This indicates that in rural scenes with strong texture variations, local boundary and fine-grained texture enhancement can effectively alleviate missed detections and improve the accuracy of boundary prediction to a certain extent. After MRA is introduced alone, Recall further increases to 96.64%, F1 and IoU reach 84.10% and 73.60%, respectively, and Boundary Precision increases to 16.94%. Clearly, under the conditions of this dataset, medium-range structural modeling can significantly enhance the recovery capability for connected farmland regions. Similarly, after TGA is introduced alone, Recall reaches 96.61% and Boundary Precision is 16.71%, indicating that global semantic constraints also help expand farmland responses and reduce some background interference. However, when MRA and TGA are used alone, Precision decreases to 75.79% and 76.37%, respectively, indicating that in background-complex datasets such as LoveDA, simply strengthening structural continuity or global semantic response can make the model tend to expand the predicted farmland range and thus introduce certain false detections.
After pairwise combinations, the comprehensive performance of each model is further improved. Among them, the Boundary Precision of No. 5 (PLFA+MRA) reaches 21.55%, the highest in the LoveDA ablation experiments, indicating that the combination of local boundary enhancement and medium-range structural modeling can better improve the accuracy of predicted boundaries. The advantage of this combination in boundary metrics indicates strong complementarity between the boundary details provided by PLFA and the regional connectivity structure learned by MRA. The OA, F1, IoU, and Kappa of No. 6 (PLFA+TGA) reach 87.10%, 88.03%, 79.20%, and 68.81%, respectively, making it the best two-module combination in terms of overall region metrics. This shows that the combination of local boundary enhancement and global semantic constraints is effective for alleviating class confusion in the LoveDA rural scenario. No. 7 (MRA+TGA) maintains relatively high Recall and good IoU, indicating that combining structural continuity with global discriminative capability helps recover more complete farmland regions, although its boundary precision is still inferior to combinations involving PLFA.
The complete model No. 8 achieves the best comprehensive performance on the LoveDA dataset, with OA, F1, IoU, and Kappa reaching 88.63%, 89.45%, 81.32%, and 71.51%, respectively, improving by 9.85, 10.30, 15.21, and 17.41 percentage points over the base model. Its Boundary Precision is 20.70%, which is slightly lower than the 21.55% of No. 5 but is clearly higher than the base model and all single-module settings and remains close to the best boundary result. It should be noted that Boundary Precision mainly measures the accuracy of predicted boundaries and does not directly reflect the complete recall of true farmland regions. Therefore, in the LoveDA scenario, the highest Boundary Precision obtained by No. 5 indicates that its predicted boundaries are more conservative and accurate, whereas No. 8 further improves overall region identification accuracy, farmland coverage completeness, and result stability while maintaining high boundary reliability. In other words, the complete model does not simply pursue the optimum of a single boundary metric, but achieves a more balanced performance among Precision, Recall, IoU, Kappa, and Boundary Precision.
Combined with Figure 9, No. 8 has fewer misidentified and missed regions in most samples. In particular, in complex regions adjacent to bare soil, low vegetation, and rural roads, it can better maintain the continuity of farmland boundaries and reduce large-area misclassification. The typical error regions marked by blue solid boxes show that, compared with the base model and some single-module models, the complete A3UNet has more stable performance in local boundaries and regional connectivity. This is basically consistent with the trends of region metrics and Boundary Precision in Table 6, indicating that the synergistic effects of PLFA, MRA, and TGA can simultaneously improve the completeness and boundary reliability of farmland identification in complex rural scenes.
Figure 9. Ablation experiment results on the LoveDA dataset (white regions indicate farmland areas, black regions indicate background areas, green regions indicate misclassified areas, red regions indicate missed areas, and blue solid boxes indicate typical error regions).
In summary, the ablation experiments show that PLFA, MRA, and TGA contribute to farmland identification from three levels: local boundary details, medium-range structural continuity, and global semantic discrimination. The introduction of Boundary Precision further verifies that these modules not only improve regional overlap accuracy but also improve the reliability of predicted boundaries. Overall, A3UNet achieves more robust farmland identification while maintaining a lightweight structure through local-medium-range-global three-level modeling.

4. Discussion

The experimental results on the GID and LoveDA datasets show that A3UNet can achieve favorable farmland identification performance with low model complexity, but the performance changes and error sources are not consistent across datasets. The GID prediction areas more often represent urban-edge or urban–rural mixed backgrounds, where farmland patches are interwoven with roads, buildings, woodland, water bodies, and other objects, and local parcels are fragmented, boundaries are tortuous, and shapes are irregular. In such scenarios, the main difficulty for the model is how to maintain the continuity of farmland boundaries under interference from complex adjacent objects and reduce missed detections in small fragmented parcels. In contrast, the rural scenes of LoveDA are closer to rural agricultural landscapes, where farmland areas have relatively stronger overall connectivity, but their internal texture, parcel scale, and arrangement direction vary more markedly, and backgrounds such as bare soil, low vegetation, and rural roads are more likely to be confused with farmland. Therefore, GID and LoveDA examine the adaptability of the model from two different perspectives: the former emphasizes boundary recovery in fragmented patches and urban-rural mixed backgrounds, while the latter emphasizes maintenance of regional connectivity and suppression of similar objects in rural agricultural landscapes.
Compared with existing segmentation models, the advantage of A3UNet does not come from larger network capacity, but from task-specific modeling of the farmland identification problem itself. Specifically, U-Net has high inference efficiency, but its fusion of local details and deep semantics is relatively direct, which easily leads to local discontinuities in complex boundaries and fragmented parcels. HRNet preserves high-resolution features, but in scenarios with limited samples and high background similarity, high-resolution representation does not bring stable class discrimination. Although CNN-Transformer hybrid models have strong contextual modeling ability, they are usually accompanied by higher parameter size and computational cost. Moreover, constrained by the scale of training data under few-sample conditions, these models are not highly competitive in the experiments of this paper. In contrast, A3UNet adopts a shallow three-level encoder–decoder structure and allocates its limited model capacity to three levels that better match the needs of farmland identification: local boundaries, medium-range structures, and global semantics. The model complexity results show that A3UNet not only has low parameter size and FLOPs, but also maintains a fast practical inference speed and achieves better overall identification accuracy on both datasets. This indicates that the lightweight nature of the proposed method is not simply achieved by reducing parameters, but by providing higher accuracy of farmland feature representation and identification speed within a lower model capacity.
The ablation experiments show that the “boundary problem” in high-resolution farmland identification cannot be simply understood as unclear local edges. Boundary errors arise from three levels: first, texture transitions at parcel edges are not obvious; second, the internal connected structures of farmland areas are cut by roads, shelterbelts, or background textures; and third, similar objects such as bare soil, low vegetation, and building edges produce erroneous responses. Therefore, although PLFA appears to enhance boundaries more directly in the recognition-result images, MRA and TGA also improve boundary reliability by improving regional structure and semantic discrimination. As a result, introducing each of the three modules alone can improve Boundary Precision. Although their action paths differ, they all ultimately make farmland boundary representation more stable.
From the perspective of geospatial representation, the deep structural features extracted by A3UNet do not only serve pixel-level classification, but also correspond to the spatial organization of farmland landscapes to some extent. Farmland in high-resolution remote sensing imagery is not an isolated set of pixels, but a landscape unit jointly composed of parcel boundaries, internal textures, connected structures, and relationships with adjacent objects. PLFA improves the model’s representation of parcel edges and local texture transitions, MRA reflects the internal continuity and medium-range spatial organization of farmland patches, and TGA constrains the semantic relationship between farmland and non-farmland from a larger range. The three types of features jointly enable the model to simultaneously focus on whether the boundary is accurate, whether the region is continuous, and whether the semantics are reliable in complex backgrounds. This local-medium-range-global feature organization has certain application value for high-resolution farmland mapping, land-cover updating, and agricultural resource monitoring.
It should be noted that the public GID and LoveDA datasets selected in this paper cannot provide precise geographic coordinates, climatic conditions, topographic relief, or crop-type annotations for each cropped sample. Therefore, this paper does not further divide the samples deterministically into plains, mountainous areas, or specific crop structures, but analyzes them based on the public descriptions of the datasets and the observable scene backgrounds, farmland morphology, and adjacent-object characteristics in the images. Meanwhile, A3UNet is mainly validated on high-resolution optical imagery and has not yet integrated multi-temporal, multispectral, or SAR remote sensing information. Future research can further combine datasets with explicit geographic zoning, crop types, and phenological stages, and introduce semi-supervised learning, multi-source remote sensing fusion, and large-area inference optimization strategies to further validate the generalization ability and engineering applicability of the model in real farmland mapping tasks.

5. Conclusions

To address the common problems of blurred boundaries, fragmented regional structures, and class confusion under complex backgrounds in high-resolution remote sensing farmland identification, this paper proposes A3UNet, a lightweight segmentation network with hierarchical attention enhancement. Built on a three-stage encoder–decoder architecture, the proposed method introduces PLFA, MRA, and TGA into different feature layers to achieve collaborative modeling of local texture, medium-range spatial relationships, and deep global semantic relationships, thereby improving the accuracy and stability of farmland identification while maintaining low model complexity.
Experimental results on the two public datasets GID and LoveDA show that A3UNet achieves the best performance on all major evaluation metrics. On the GID dataset, OA, F1, IoU, and Kappa reach 90.92%, 90.77%, 83.22%, and 81.60%, respectively; on the LoveDA dataset, they reach 88.63%, 85.67%, 75.87%, and 71.51%, respectively, outperforming comparison methods such as U-Net, HRNet, BANet, FT-UNetFormer, DCSwin, and EMCAD overall. Meanwhile, A3UNet has only 2.51 MB parameters and 2.92 G FLOPs, indicating that the proposed method does not rely on a larger network scale, but instead achieves more effective farmland feature enhancement on a lightweight backbone through targeted hierarchical attention design.
The ablation experiments further show that the three attention modules have complementary relationships. The complete A3UNet achieves more stable performance in most region-overlap metrics and boundary evaluation metrics, indicating that the joint modeling of local detail enhancement, regional structure preservation, and semantic misclassification suppression helps improve the quality of farmland identification in complex scenes.
Future work will further combine multi-temporal and multi-source remote sensing data with semi-supervised learning strategies to validate the generalization ability and engineering application potential of the model over larger areas and more complex agricultural landscapes.

Author Contributions

Conceptualization, Z.Y. and X.R.; Methodology, Z.Y.; Software, Z.Y.; Validation, Z.Y.; Formal analysis, Z.Y.; Investigation, Z.Y.; Data curation, Z.Y.; Writing—original draft, Z.Y.; Writing—review and editing, Z.Y. and X.R.; Visualization, Z.Y.; Supervision, X.R.; Project administration, X.R.; Funding acquisition, X.R. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Natural Science Foundation of China (Grant No. 42376180).

Data Availability Statement

The datasets used in this study are publicly available. The GID dataset can be accessed at https://x-ytong.github.io/project/GID.html (accessed on 1 March 2026), and the LoveDA dataset can be accessed at https://github.com/Junjue-Wang/LoveDA (accessed on 3 March 2026).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Sun, B.; Luo, Y.; Yang, D.; Yang, J.; Zhao, Y.; Zhang, J. Coordinative management of soil resources and agricultural farmland environment for food security and sustainable development in China. Int. J. Environ. Res. Public Health 2023, 20, 3233. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  2. Zheng, J.; Ye, Z.; Wen, Y.; Huang, J.; Zhang, Z.; Li, Q.; Hu, Q.; Xu, B.; Zhao, L.; Fu, H. A comprehensive review of agricultural parcel and boundary delineation from remote sensing images: Recent progress and future perspectives. IEEE Geosci. Remote Sens. Mag. 2026, 14, 2–33. [Google Scholar] [CrossRef] [Scilit]
  3. Wang, X.; Shu, L.; Han, R.; Yang, F.; Gordon, T.; Wang, X.; Xu, H. A survey of farmland boundary extraction technology based on remote sensing images. Electronics 2023, 12, 1156. [Google Scholar] [CrossRef] [Scilit]
  4. Chen, Y.; Xie, Y.; Yao, W.; Zhang, Y.; Wang, X.; Yang, Y.; Tang, L. U-mga: A multi-module unet optimized with multi-scale global attention mechanisms for fine-grained segmentation of cultivated areas. Remote Sens. 2025, 17, 760. [Google Scholar] [CrossRef] [Scilit]
  5. Chen, Y.; Qiu, S.; Yang, Y.; Liu, Z.; Yao, W.; Zhang, Y.; Tang, L. FarmChanger: A Diffusion-Guided Network for Farmland Change Detection. Remote Sens. 2025, 18, 38. [Google Scholar] [CrossRef] [Scilit]
  6. Saleem, M.H.; Potgieter, J.; Arif, K.M. Automation in agriculture by machine and deep learning techniques: A review of recent developments. Precis. Agric. 2021, 22, 2053–2091. [Google Scholar] [CrossRef] [Scilit]
  7. Ronneberger, O.; Fischer, P.; Brox, T. U-Net: Convolutional Networks for Biomedical Image Segmentation. In Proceedings of the 18th International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI), Munich, Germany, 5–9 October 2015; pp. 234–241. [Google Scholar]
  8. Jiao, L.; Wang, M.; Liu, X.; Li, L.; Liu, F.; Feng, Z.; Yang, S.; Hou, B. Multiscale deep learning for detection and recognition: A comprehensive survey. IEEE Trans. Neural Netw. Learn. Syst. 2024, 36, 5900–5920. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  9. Xie, Y.; Rui, X.; Zou, Y.; Tang, H.; Ouyang, N.; Ren, Y. STDPNet: Supervised transformer-driven network for high-precision oil spill segmentation in SAR imagery. Int. J. Appl. Earth Obs. Geoinf. 2025, 143, 104812. [Google Scholar] [CrossRef] [Scilit]
  10. Wang, L.; Li, R.; Zhang, C.; Fang, S.; Duan, C.; Meng, X.; Atkinson, P.M. UNetFormer: A UNet-like transformer for efficient semantic segmentation of remote sensing urban scene imagery. ISPRS J. Photogramm. Remote Sens. 2022, 190, 196–214. [Google Scholar] [CrossRef] [Scilit]
  11. Wang, L.; Li, R.; Wang, D.; Duan, C.; Wang, T.; Meng, X. Transformer meets convolution: A bilateral awareness network for semantic segmentation of very fine resolution urban scene images. Remote Sens. 2021, 13, 3065. [Google Scholar] [CrossRef] [Scilit]
  12. Wang, L.; Li, R.; Duan, C.; Zhang, C.; Meng, X.; Fang, S. A novel transformer based semantic segmentation scheme for fine-resolution remote sensing images. IEEE Geosci. Remote Sens. Lett. 2022, 19, 1–5. [Google Scholar] [CrossRef] [Scilit]
  13. Chen, J.; Mei, J.; Li, X.; Lu, Y.; Yu, Q.; Wei, Q.; Luo, X.; Xie, Y.; Adeli, E.; Wang, Y. TransUNet: Rethinking the U-Net architecture design for medical image segmentation through the lens of transformers. Med. Image Anal. 2024, 97, 103280. [Google Scholar] [CrossRef] [Scilit]
  14. Xie, Y.; Zhang, H.; Rui, X.; Tang, H.; Ouyang, N.; Zou, Y. MSAttU-Net: A water body extraction network for Nanjing that overcomes interference in shaded areas. IEEE Geosci. Remote Sens. Lett. 2025, 22, 1–5. [Google Scholar] [CrossRef] [Scilit]
  15. Rahman, M.M.; Munir, M.; Marculescu, R. Emcad: Efficient multi-scale convolutional attention decoding for medical image segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 17–21 June 2024; pp. 11769–11779. [Google Scholar]
  16. Li, Z.; Xue, Z.; Xu, Q.; Zhang, L.; Zhu, T.; Zhang, M. SPFormer: Self-pooling transformer for few-shot hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2023, 62, 1–19. [Google Scholar] [CrossRef] [Scilit]
  17. Li, Z.; Wang, Y.; Tian, F.; Zhang, J.; Chen, Y.; Li, K. BAFormer: A novel boundary-aware compensation UNet-like transformer for high-resolution cropland extraction. Remote Sens. 2024, 16, 2526. [Google Scholar] [CrossRef] [Scilit]
  18. Shu, T.; Shen, L.; Wang, Y.; Zhang, P. FADConv: A frequency-aware dynamic convolution for cropland non-agriculturalization identification and segmentation. Int. J. Appl. Earth Obs. Geoinf. 2026, 146, 105014. [Google Scholar] [CrossRef] [Scilit]
  19. Xu, Y.; Zhu, Z.; Guo, M.; Huang, Y. Multiscale edge-guided network for accurate cultivated land parcel boundary extraction from remote sensing images. IEEE Trans. Geosci. Remote Sens. 2023, 62, 1–20. [Google Scholar] [CrossRef] [Scilit]
  20. Li, F.; Xu, L.; Ma, Z.; Zhao, Y.; Li, X. APU-Net: A U-Net Enhanced Network with Dynamic Feature Fusion and Pyramid Cross-Attention Mechanism for Polyp Segmentation. Digit. Signal Process. 2025, 172, 105879. [Google Scholar] [CrossRef] [Scilit]
  21. Wang, D.; Cao, W.; Zhang, F.; Li, Z.; Xu, S.; Wu, X. A review of deep learning in multiscale agricultural sensing. Remote Sens. 2022, 14, 559. [Google Scholar] [CrossRef] [Scilit]
  22. Wang, C.; Ge, X.; Zhao, Y.; Cai, J.; Xia, Y.; Wen, Z.; Feng, H.; Fang, K.; Gadekallu, T.R. A Comprehensive Survey on Farmland Segmentation: Methodologies, Applications, and the Road to Agriculture 5.0. Authorea Prepr. 2026. [Google Scholar] [CrossRef] [Scilit]
  23. Zhou, Q.; Wang, L.; Gao, G.; Kang, B.; Ou, W.; Lu, H. Boundary-guided lightweight semantic segmentation with multi-scale semantic context. IEEE Trans. Multimed. 2024, 26, 7887–7900. [Google Scholar] [CrossRef] [Scilit]
  24. Sun, K.; Xiao, B.; Liu, D.; Wang, J. Deep high-resolution representation learning for human pose estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 16–20 June 2019; pp. 5693–5703. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.