In precision agriculture, fruit segmentation serves as a fundamental visual prerequisite for orchard robotic operations, including precision management, automated harvesting and yield estimation. For unripe passion fruits, complex scene interference, high fruit–leaf similarity and foliage occlusion in practical orchard scenes easily cause missed detection and over-segmentation in existing models. To address these challenges, we build a multi-scene unripe-passion-fruit dataset named ZKMPF. Based on the UNet architecture, we propose Environment-Adaptive and Prompt-Fusion UNet (EAPF-UNet). First, EAPF-UNet embeds an Environmental Adapter into the encoder, which adjusts feature parameters to mitigate complex scenes interference. Then, it incorporates a Localization Multi-Scale Fusion Module (LMSM) and Refinement Multi-Scale Fusion Module (LMFM) to achieve accurate localization and refinement of unripe passion fruits and address scale variations. Finally, it designs the Multi-Dimensional Prompt Fusion module that integrates color, geometry and texture priors to improve the feature discriminability between unripe passion fruits and background. We conduct experiments on our self-built dataset, comparing EAPF-UNet with eight other segmentation models. Evaluated against eight segmentation models, EAPF-UNet obtains mDice of 85.51% and mIoU of 77.16% across six metrics and achieves competitive segmentation results within this dataset’s test scenes.
In natural scenes, the high resemblance between unripe tomatoes and foliage, combined with severe occlusion, challenges current semantic segmentation models, causing poor accuracy and indistinct boundaries. To overcome this, we propose CMAE-UNet, a camouflage suppression and edge enhancement model based on the UNet architecture. Specifically, a Global-Local Integrated Spatial Attention (GLISA) encoder merges dual-branch dilated convolutions, residual structures, and an Efficient Multi-scale Attention mechanism to expand receptive fields and highlight targets in complex backgrounds. Furthermore, a Frequency-Domain Feature Enhancement (FFE) module leverages the Fast Fourier Transform to separate and adaptively enhance distinct frequency components, effectively mitigating camouflage interference. Additionally, a Directional Edge Enhancement (DEE) module uses three-directional learnable convolutions and spatial attention to sharpen indistinct target contours. Evaluated on a custom Tomato dataset encompassing five complex scenarios, CMAE-UNet outperforms 12 prominent methods in mIoU, Dice, and Sen metrics, yielding smoother and more precise segmentation boundaries. The model robustly withstands field interference, providing strong technological support for automated tomato detection, intelligent harvesting, and growth monitoring.