Skip to main content
QUICK REVIEW

[Paper Review] A SAM-based Solution for Hierarchical Panoptic Segmentation of Crops and Weeds Competition

Khoa Dang Nguyen, Thanh-Hai Phung|arXiv (Cornell University)|Sep 24, 2023
Smart Agriculture and AIAgricultural and Biological Sciences6 citations
TL;DR

This paper presents a hybrid approach combining fine-tuned YOLO-v8 and DINO object detectors with HQ-SAM for hierarchical panoptic segmentation of crops and weeds. By using detector-generated bounding boxes as prompts for HQ-SAM, the method achieves a PQ+ score of 81.33 on the PhenoBench dataset, outperforming baseline models and demonstrating strong generalization on complex agricultural scenes with thin-structured plants.

ABSTRACT

Panoptic segmentation in agriculture is an advanced computer vision technique that provides a comprehensive understanding of field composition. It facilitates various tasks such as crop and weed segmentation, plant panoptic segmentation, and leaf instance segmentation, all aimed at addressing challenges in agriculture. Exploring the application of panoptic segmentation in agriculture, the 8th Workshop on Computer Vision in Plant Phenotyping and Agriculture (CVPPA) hosted the challenge of hierarchical panoptic segmentation of crops and weeds using the PhenoBench dataset. To tackle the tasks presented in this competition, we propose an approach that combines the effectiveness of the Segment AnyThing Model (SAM) for instance segmentation with prompt input from object detection models. Specifically, we integrated two notable approaches in object detection, namely DINO and YOLO-v8. Our best-performing model achieved a PQ+ score of 81.33 based on the evaluation metrics of the competition.

Motivation & Objective

  • To address the challenge of accurate hierarchical panoptic segmentation in agricultural scenes, particularly for crops and weeds with complex, thin-structured morphology.
  • To improve instance and semantic segmentation performance in field-level plant phenotyping using a modular pipeline combining object detection and segmentation models.
  • To evaluate the effectiveness of prompt-based segmentation with fine-tuned SAM variants on real-world agricultural datasets with high-quality annotations.
  • To optimize model performance through targeted fine-tuning, LoRA adaptation, and ensemble detection strategies for improved robustness across plant types.

Proposed method

  • The method employs a two-stage pipeline: first, object detection models (YOLO-v8 and DINO) generate bounding box prompts for segmentation.
  • The Segment Anything in High-Quality (HQ-SAM) model is used as the segmentation backbone, with fine-tuning on the PhenoBench dataset using ground-truth and augmented bounding boxes.
  • Box augmentation is applied during HQ-SAM fine-tuning, adding random noise (up to 20 pixels or 10% of box size) to improve robustness to imperfect detector outputs.
  • LoRA fine-tuning is applied to HQ-SAM to enhance GPU memory efficiency and enable training on consumer hardware.
  • Detector outputs are merged using an IOU threshold of 0.5 to remove duplicates, with additional filtering for weed detections exceeding 50 pixels in width and height.
  • Training uses AdamW with cosine annealing learning rate schedule, early stopping after 20 epochs of no improvement, and mixed-precision training for memory efficiency.

Experimental results

Research questions

  • RQ1Can prompt-based segmentation using detector-generated bounding boxes achieve high performance in hierarchical panoptic segmentation of crops and weeds?
  • RQ2How does fine-tuning HQ-SAM with box augmentation and LoRA improve segmentation accuracy on complex agricultural scenes?
  • RQ3What is the comparative performance of YOLO-v8 and DINO in detecting different plant types (weeds, crops, leaves) in the PhenoBench dataset?
  • RQ4To what extent does combining multiple detectors (YOLO-v8 and DINO) improve detection and segmentation robustness?
  • RQ5How does the choice of model architecture (e.g., ViT-Base vs. ViT-Huge) affect inference quality and training efficiency in this pipeline?

Key findings

  • The best-performing model achieved a PQ+ score of 81.33 on the PhenoBench dataset, outperforming other reported methods including Mask R-CNN and Mask2Former.
  • YOLO-v8 nano achieved comparable weed detection performance to the larger DINO model, indicating high efficiency and effectiveness for weed segmentation.
  • DINO demonstrated superior performance in detecting leaves and crops, while YOLO-v8 excelled in weed detection, justifying the use of both detectors in ensemble.
  • Fine-tuned HQ-SAM with detector-generated prompts significantly outperformed the baseline HQ-SAM using ground-truth boxes, demonstrating the value of end-to-end adaptation.
  • The use of LoRA during HQ-SAM fine-tuning enabled effective parameter-efficient adaptation with reduced memory usage, supporting training on consumer-grade GPUs.
  • Automatic Mixed Precision (AMP) improved training efficiency but reduced AP scores for the leaf detector, indicating task-specific trade-offs in mixed-precision usage.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.