3.2. CLIP-Based Decoupled Cross-Modal Distillation (Stage 1)
Under weak supervision with only image-level labels, conventional classification-based methods tend to generate spatially incomplete class activation maps (CAMs), because the classification objective usually encourages the network to focus on only the most discriminative regions of target objects. To alleviate this localization bias, we introduce CLIP as a cross-modal teacher to regularize and refine the classification responses of the backbone. However, CLIP is pretrained predominantly on generic web-scale image-text pairs rather than specialized remote sensing imagery, resulting in a considerable domain gap when it is directly applied to remote sensing scenes. To retain the zero-shot generalization ability of CLIP while adapting its representations to remote-sensing-specific semantics, we design a remote-sensing-oriented prompt ensemble and a lightweight visual adaptation mechanism.
To preserve the generalizable knowledge encoded in CLIP, both its visual and textual encoders remain frozen throughout training. On the textual branch, we construct a remote-sensing-oriented prompt ensemble for each target class. Specifically, the ensemble comprises five fixed templates: “a satellite image of [class]”, “aerial view of [class]”, “a top-down view of [class] area”, “satellite photo showing [class]”, and “a remote sensing image of [class]”. The same five templates are shared across all three datasets, whereas [class] is replaced with the dataset-specific semantic category name. Thus, each dataset has its own set of class-level text representations according to its category definitions. Only the semantic categories involved in training and evaluation are included in prompt construction. For each category, the resulting five text embeddings are individually L2-normalized, averaged, and normalized again to form the final class-level representation. By incorporating alternative descriptions of overhead imagery, the ensemble reduces dependence on any single prompt expression and provides a more stable textual representation for each remote-sensing category.
On the visual branch, a residual adapter controlled by a learnable scaling coefficient is appended to the frozen CLIP visual encoder. By updating only the lightweight adapter and its scaling coefficient, the proposed design adapts the generic CLIP representation space to the remote sensing domain while reducing the risk of catastrophic forgetting that may arise from full-parameter fine-tuning. Given an original visual feature
extracted by the CLIP visual encoder, the adapted feature is computed as
where
denotes a lightweight multilayer perceptron consisting of two fully connected layers and a ReLU activation function. The learnable scalar
controls the strength of the residual domain adaptation and is jointly optimized with the adapter parameters. The operator
denotes L2 normalization along the feature dimension. The adapted image feature
is then compared with the normalized textual embeddings of all classes through dot-product similarity. The resulting similarities are multiplied by a fixed logit scaling factor of 100 to produce the multi-label classification logits of the CLIP branch.
The adapter and the scaling coefficient are optimized using an image-level multi-label soft-margin loss to capture remote-sensing-specific semantics. The resulting class predictions are subsequently employed as soft supervision for the student backbone. Within the backbone, hierarchical features extracted by the Transformer encoder are processed by primary and auxiliary classifiers. Their corresponding CAMs are generated by applying the learned classifier weights to the feature maps without introducing additional learnable parameters.
Remote sensing scenes commonly contain multiple coexisting land-cover categories. However, conventional Softmax-based KL-divergence distillation forces the class probabilities to sum to one, thereby introducing artificial competition among different categories. A high probability assigned to one class may consequently suppress the responses of other coexisting classes. To address this limitation, we propose a sigmoid-based decoupled distillation mechanism that decomposes multi-class supervision into C independent binary distillation problems. Under this formulation, the probability of each category is estimated independently, avoiding mutual suppression among coexisting categories.
Let
and
denote the logits produced by the student backbone and the domain-adapted CLIP teacher for the
c-th class, respectively. The teacher soft targets are computed as
where
denotes the soft target provided by the CLIP teacher, and
is the temperature hyperparameter shared by the teacher and student branches during distillation. It controls the smoothness of the teacher soft targets and the corresponding temperature-scaled student predictions. During distillation,
is detached from the computation graph and treated as a fixed supervisory target. Consequently,
optimizes the visual adapter and the scaling coefficient
, whereas
updates only the student backbone. Therefore, the gradients of the distillation loss are propagated only through the student branch. The decoupled distillation loss is formulated as
where
denotes the binary cross-entropy with logits loss, and
C denotes the number of target classes. Following common temperature-scaled distillation practice, the factor
is introduced to balance the gradient magnitude.
The overall training objective of Stage 1 integrates multiple complementary supervision signals:
where
and
denote the primary and auxiliary multi-label classification losses, respectively. The losses
and
regularize feature consistency at the patch-token and class-token levels. The segmentation loss
is computed using pseudo-labels generated from the fused CAMs, while
denotes the dense energy regularization loss used to improve object-boundary alignment.
promotes consistency between the outputs of the primary and foreground decoder branches. The effects of the two CLIP-related loss weights introduced in this work are quantitatively evaluated on the LoveDA dataset, as reported in the subsequent ablation study.Based on this comparison,
and
are selected as the default settings for all experiments. It should be emphasized that
and
are binary scheduling gates rather than tunable loss weights, and their values are restricted to either 0 or 1. Specifically,
for
and
for
, thereby postponing cross-modal distillation until the adapter has learned an effective domain mapping. Similarly,
for
and
for
, delaying the segmentation-related objectives until the CAM-derived pseudo-labels become sufficiently reliable.
Through the proposed decoupled cross-modal distillation mechanism, the domain-adapted CLIP teacher provides independent class-wise semantic supervision for the student backbone. This formulation avoids the artificial inter-class competition introduced by Softmax-based distillation and is more compatible with multi-label remote sensing scenes. The transferred semantic supervision helps the student generate more comprehensive class responses, thereby improving the spatial coverage and structural completeness of the initial CAMs. These CAMs subsequently provide more reliable localization cues for pseudo-label refinement.
3.3. Semantic-Guided Pseudo-Label Refinement (Stage 2)
After the cross-modal semantic alignment in the first stage, the regional completeness of initial CAMs is substantially improved. However, due to the low spatial resolution of deep classification features, the resulting activation regions remain coarse along physical boundaries and cannot be directly used as pixel-level supervision. To obtain reliable pseudo-labels, SAM is used as a mask generator under semantic and spatial constraints rather than as a standalone boundary refinement module. Nevertheless, applying SAM to remote sensing scenes poses two key challenges. First, SAM heavily relies on clear low-level image edges, rendering it prone to merging multiple distinct semantic instances into a single target when confronted with large, contiguous, and geometrically irregular land covers. Second, directly using coarse CAMs as SAM prompts introduces substantial background noise and induces conflicts between predicted masks and semantic categories.
To address these challenges, a reliable seed label is first constructed, after which a DINOv2-guided Semantic Decomposition (DSD) module and a Spatial–Semantic Constraint (SSC) module are jointly designed to guide SAM toward accurate segmentation. The overall pipeline is illustrated in
Figure 3.
3.3.1. Multi-Branch Probability Fusion and Confidence Filtering
To obtain a seed label more robust than a single CAM, the multi-branch probability outputs of the Stage-1 model are fully exploited. Given an input image
, the segmentation decoder and the dual classification heads of the Stage-1 network respectively produce three probability tensors: the segmentation probability map
, the primary class activation map
, and the auxiliary class activation map
, where
C denotes the total number of classes, and
denotes the spatial resolution. These three probability tensors are combined element-wise using predefined weights:
where
denotes the fused multi-view probability tensor, and
,
, and
are the corresponding fusion weights. The fusion coefficients satisfy
and
. Since the segmentation decoder provides dense pixel-level predictions, it is assigned a dominant weight in the fusion. In contrast, the primary and auxiliary CAMs provide complementary but spatially coarser localization cues. The two CAM branches are assigned equal weights because they play the same auxiliary role in seed generation. An ablation study was conducted to compare and validate multiple representative weight configurations, as presented in the subsequent experimental analysis. The experimental results demonstrate that
provides the best overall performance and is therefore selected as the final weight configuration. Subsequently, a per-pixel preliminary class map is obtained by applying
along the channel dimension:
To filter out pixels with insufficient prediction confidence, a confidence threshold
is applied as a secondary screening at each pixel location:
where the threshold is empirically set to
. The resulting map is the Reliable Seed Mask (RSM), which serves as the unified input to the subsequent DSD and SSC modules. This step elevates the quality of the SAM input seeds from that of a single CAM to that of a high-confidence view dominated by the segmentation probability, providing the foundation for the SAM-based pseudo-label refinement.
3.3.2. DINOv2-Guided Semantic Decomposition (DSD)
While the RSM exhibits relatively high class confidence, it often presents a particular failure mode on large homogeneous categories such as water bodies, farmland, forests, and barren land: due to the limited resolution of CAMs and the homogeneity of classification responses, multiple spatially adjacent but physically independent land-cover instances are erroneously merged into a single connected region. If such a region is directly fed into SAM as a prompt, SAM generates a single mask along its bounding box, lumping multiple independent objects into one output and consequently losing the instance boundaries.
To address this issue, a DINOv2-guided Semantic Decomposition (DSD) module is proposed, which performs semantic decoupling on adhered connected regions using high-dimensional semantic features before they enter SAM. Through self-supervised pretraining, DINOv2 exhibits notable intra-class compactness in its deep feature space: pixel feature vectors belonging to the same semantic class spontaneously form compact clusters on the manifold, while different instances, even within the same class, retain distinguishable differences in feature distribution. This property effectively compensates for SAM’s limitation of relying solely on low-level visual edges.
Specifically, given an input image, DINOv2 first extracts a pixel-level feature map
, where
H,
W, and
d denote its height, width, and feature dimension, respectively. For each target large-scale category
c, a class-specific binary candidate mask
is extracted from the RSM, and its area
is calculated as the number of foreground pixels. Semantic decomposition is activated when
; otherwise, the candidate mask is retained without decomposition to avoid unnecessary fragmentation. For each activated candidate mask, the corresponding DINOv2 features are clustered using
K-Means. The cluster number
K controls the decomposition granularity and is determined by a predefined dataset- and area-dependent rule as detailed in the implementation settings. The objective function is defined as
where
denotes the
k-th semantic cluster,
denotes its feature centroid, and
denotes the Euclidean norm. By exploiting the semantic consistency of DINOv2 features, DSD decomposes a spatially merged candidate mask into finer semantic clusters. Connected-component analysis is then applied to each cluster mask to obtain spatially separated sub-regions for SAM prompting, thereby reducing the risk of merging adjacent land-cover regions into a single mask.
3.3.3. Spatial–Semantic Constraint Module (SSC)
After DSD-based decomposition, the resulting sub-regions are represented as binary masks and therefore cannot be directly used as prompts for SAM. Moreover, although SAM can generate high-quality masks in a class-agnostic manner, it lacks explicit mechanisms for preventing mask over-expansion, inter-instance confusion, and semantic conflicts with existing predictions. The SSC module therefore performs two complementary functions: it converts the sub-regions into reliable geometric prompts for SAM and applies geometric and semantic constraints to SAM’s raw outputs, thereby improving the stability and semantic consistency of the final pseudo-labels in scenes containing multiple co-occurring classes.
For each candidate region
R supplied to SAM, where
R is either a DSD-derived sub-region or the original connected region when DSD is not activated, SSC constructs a point prompt and a box prompt for SAM. The box prompt is defined as the tight bounding box of
R without outward padding, thereby avoiding the inclusion of semantically irrelevant background areas. The positive point prompt is selected as the pixel with the highest confidence in the class-specific probability map:
where
denotes the probability map for class
c obtained during RSM generation. Compared with using the geometric centroid, this probability-guided selection avoids cases in which the centroid of a connected region lies within a background hole or a boundary transition area, thereby placing the positive prompt in the high-confidence interior of the corresponding land-cover region. The point and box prompts provide complementary information: the box prompt conveys the approximate spatial extent of the candidate region, whereas the point prompt provides a reliable class-consistent foreground anchor. Their joint use reduces the boundary drift that may occur when SAM is guided solely by a box prompt.
When SAM processes adjacent regions with similar textures, it may expand toward the boundaries of the prompt box and produce a mask substantially larger than the corresponding candidate region. To address this issue, we introduce an area-ratio constraint. Specifically, given a SAM-generated mask
and its corresponding candidate region
R, the predicted mask is identified as over-segmented and discarded if
where
and
denote the areas of the SAM-generated mask and its corresponding candidate region, respectively. If this condition is satisfied, the SAM prediction is rejected, and the corresponding candidate region is assigned the ignore index in the final pseudo-label to avoid introducing noisy supervision during training. Since the area ratio is dimensionless, the threshold
does not require explicit rescaling according to the ground sampling distance. We set
for all three datasets. This value permits moderate mask expansion to compensate for incomplete initial localization while suppressing severe over-expansion.
In remote sensing scenes containing multiple co-occurring classes, masks generated for different classes may overlap at the same pixel locations. Updating the pseudo-labels solely according to mask generation order could allow a subsequently processed class to overwrite an earlier high-confidence prediction, resulting in semantic inconsistency. To prevent this, SSC allows a SAM prediction to update only those RSM pixels that are assigned to the same semantic class as the current candidate region, the ignore label (255), or a designated background label, where applicable. Pixels carrying high-confidence predictions of other foreground classes are protected from being overwritten. This conflict-resolution rule implicitly uses the confidence-filtered RSM to preserve reliable foreground predictions while allowing ignored and eligible background regions to be refined by SAM. Consequently, it prevents SAM masks from incorrectly encroaching upon regions belonging to other classes because of visual similarity.
By combining DSD-based semantic decomposition with SSC-based prompt construction, area-ratio constraint, and conflict-aware label updating, the framework ultimately produces refined pseudo-labels (RPLs) with accurate boundaries and reliable semantic assignments. These pseudo-labels provide high-quality pixel-level supervision for the end-to-end segmentation network in Stage 3.
3.4. Warm-Start Retraining (Stage 3)
Although the cascade framework based on multiple vision foundation models achieves remarkable performance in the pseudo-label generation stage, the substantial parameter count and high inference latency of CLIP and SAM make it impractical to directly deploy them in real-world remote sensing observation tasks. At the same time, the high-quality pseudo-labels generated in Stage 2 provide a strong basis for further improving the performance of weakly supervised models. To this end, a warm-start retraining stage is designed, in which an efficient feed-forward fully convolutional segmentation network is trained under the supervision of the refined pseudo-labels to enable end-to-end high-accuracy inference.
Specifically, rather than reinitializing the final segmentation network from generic ImageNet-pretrained weights, we initialize it using the backbone weights learned in Stage 1; instead, the backbone weights optimized by decoupled distillation in Stage 1 are loaded as a warm start. At inference, only the compact segmentation network is retained, avoiding the computational overhead of CLIP, DINOv2, and SAM. In terms of supervision design, although the pseudo-labels have been refined by DSD and SSC, residual noise may still exist in boundary transition zones. A cross-entropy loss with label smoothing is therefore adopted to implicitly regularize the noisy labels and to alleviate overfitting to incorrect supervision. Furthermore, the standard cross-entropy loss is sensitive to the class imbalance commonly observed in remote sensing land covers, and the independence of pixel-wise losses makes it difficult to constrain the overall geometric shape of segmented regions. To address these limitations, the Lovász-Softmax loss is introduced alongside the cross-entropy loss. Let
p denote the prediction probability map produced by the network and
y denote the corresponding refined pseudo-label map; the joint training objective in the retraining stage is defined as
where
t denotes the training epoch and
is an epoch-dependent weight for the Lovász-Softmax loss, defined as
The two losses serve complementary roles: the cross-entropy loss ensures the accuracy of local pixel-wise classification, while the Lovász-Softmax loss directly optimizes the per-class IoU metric, enhancing the model’s ability to fit complex land-cover boundaries at the regional level. This combination is particularly effective in class-imbalanced scenarios.
Through warm-start initialization combined with joint loss optimization, the deployed segmentation network is fully decoupled from the inference of any large foundation model. This substantially narrows the performance gap between weakly supervised and fully supervised segmentation models, enabling end-to-end, low-latency, high-accuracy remote sensing image segmentation.