摘要
Accurate semantic segmentation is fundamental to precision agriculture, enabling crop coverage estimation, yield prediction, and resource optimization. However, collecting pixel-level annotations at scale is costly, motivating the use of unsupervised domain adaptation (UDA) to transfer knowledge from annotated (source) to unlabeled (target) datasets. Existing UDA methods, primarily designed for generic visual tasks, struggle with the unique domain shifts in agricultural imagery caused by variations in crop morphology, growth stage, illumination, and imaging conditions. These challenges often result in oversegmentation, under segmentation, and crop-weed misclassification. To address these issues, we propose cross-crop UDA (CCUDA), a transformer-based UDA framework tailored for agricultural domain adaptation. CCUDA leverages mid-level cues—such as row patterns and background textures—that remain consistent across crop types and environments. It employs a hybrid training strategy that combines supervised learning on the source domain with self-training on the target domain through pseudolabels. To mitigate noise in pseudolabels, we introduce masked adversarial alignment, which focusses alignment on uncertain, low-confidence regions while preserving stable representations of confident pixels. Furthermore, to resolve the feature overlap in logit space between crops and weeds due to high interclass similarity, CCUDA incorporates a logit-distance regularizer that enforces explicit separation in logit space, enhancing class discriminability. Finally, a stage-aware sampling strategy balances data exposure across varying crop growth stages, addressing dataset imbalance. CCUDA integrates seamlessly with existing UDA frameworks and, when applied to four state-of-the-art baselines across eight agricultural datasets, achieves up to +5.23% higher mean intersection over union (mIoU) and a +10.04% improvement in crop-class IoU, establishing new benchmarks for robust and generalizable agricultural segmentation.