Weakly Supervised Panoptic Segmentation for Defect-Based Grading of Fresh Produce
Manuel Knott, Divinefavour Odion, Sameer Sontakke, Anup Karwa, Thijs Defraeye
TL;DR
The paper tackles defect-based grading of fresh produce under low-data conditions by leveraging the Segment Anything Model to generate dense panoptic masks from sparse annotations and training a downstream panoptic segmentation model on those masks. The approach reduces manual annotation effort while enabling counting and sizing of visible defects on bananas, validated on 476 images with 1440 defects. Results show that SAM-generated masks largely align with human annotations, enabling similar panoptic quality to fully supervised training, with some failure modes for small or elongated defects. The study demonstrates practical potential for defect quantification in low-data agricultural settings while outlining limitations and directions for improvement.
Abstract
Visual inspection for defect grading in agricultural supply chains is crucial but traditionally labor-intensive and error-prone. Automated computer vision methods typically require extensively annotated datasets, which are often unavailable in decentralized supply chains. We address this challenge by evaluating the Segment Anything Model (SAM) to generate dense panoptic segmentation masks from sparse annotations. These dense predictions are then used to train a supervised panoptic segmentation model. Focusing on banana surface defects (bruises and scars), we validate our approach using 476 field images annotated with 1440 defects. While SAM-generated masks generally align with human annotations, substantially reducing annotation effort, we explicitly identify failure cases associated with specific defect sizes and shapes. Despite these limitations, our approach offers practical estimates of defect number and relative size from panoptic masks, underscoring the potential and current boundaries of foundation models for defect quantification in low-data agricultural scenarios. GitHub: https://github.com/manuelknott/banana-defect-segmentation
