PineRipeSeg: a lightweight texture-edge-aware network for pineapple instance segmentation and ripeness classification in field environments
Abstract
Dense leaf occlusion and fruit–leaf feature confusion hinder simultaneous extraction of pineapple instance contours and appearance-based ripeness classification in field images. A dataset of 6,019 field images and 9,393 polygon-annotated Bali pineapple instances was constructed, with fruits categorized as Unripe, Partially ripe, or Ripe according to standardized external-appearance criteria. PineRipeSeg, a lightweight YOLO11n-seg-based network, was developed. Its principal contribution is the proposed Texture-Edge Decoupling Attention (TEDA) module, which exploits the contrast between multidirectional pineapple-eye textures and elongated leaf edges to enhance fruit-surface features and suppress leaf interference. GhostConv reduces redundant computation, whereas an intersection-over-union (IoU) loss with scaled auxiliary boxes, termed Inner-IoU, refines occluded-fruit localization. Mean average precision (mAP) reached 98.1% for boxes at IoU 0.5, 98.0% for masks at IoU 0.5, and 82.2% for masks across IoU 0.5 -0.95, exceeding YOLO11n-seg by 5.0, 5.2, and 3.4 percentage points, respectively. Missed detections decreased by 77.8%. The model required 8.7 giga floating-point operations (GFLOPs), occupied 5.1 MB, and processed 121 frames per second (FPS). Comparative, ablation, repeated-run, challenging-scene, and heatmap analyses supported its effectiveness under occlusion and similarly colored backgrounds. PineRipeSeg provides a lightweight two-dimensional method for occlusion-aware hybrid instance segmentation and external ripeness assessment in field environments.