Abstract
Traditionally, soybean seed quality assessment relies on manual inspection using USDA grading sheets: a subjective, labor-intensive, and expensive process prone to human error. To address these limitations, this study builds a custom soybean seed dataset and introduces “SDAssessment”, a computer vision framework designed to automate the segmentation of multiple surface damage types (wrinkles, dark spots, and other damage) in soybean seed images. To address the severe class imbalance posed by highly localized and fine-grained damages, we propose a novel iterative class-weighted loss-tuning strategy paired with a composite loss function. A total of 11,502 damaged seeds were collected, and a custom-designed imaging system captured 1,278 images, each containing multiple seeds. We manually drew polygon annotations around the edges of wrinkles, dark spots, and other damages, and trained YOLO-based segmentation models (YOLOv8n-seg, YOLOv8m-seg, YOLOv11m-seg) to detect seeds. Using our tailored optimization framework, we evaluated seven segmentation architectures (U-Net, U-Net++, DeepLabv3, DeepLabv3+, SegFormer, and Swin-Base+UperNet) for multiple-damage segmentation on a dataset of 9,332 augmented images with 83,988 seeds. The best-performing models, YOLOv8n-seg and Swin-Base+UperNet, were used to assess seed quality. The YOLOv8n-seg model achieved 99.4% precision and 100% recall for seed detection in images. Among the segmentation models, Swin-Base+UperNet optimized with our composite loss strategy performed best, achieving Dice (F1) scores of 81.60% for wrinkles, 58.23% for dark spots, and 80.97% for the other damage category. The framework was deployed in a prototype web application to demonstrate its practical feasibility. This application allows users to upload seed images, isolate them, and automatically segment damage within each seed to quantify damage metrics (count, location, and area). Overall, this framework provides an alternative to manual seed inspection and may support future developments in automated seed sorting and grading.
Keywords
Semantic segmentation, Vision Transformers, Convolutional Neural Networks, Deep Learning, Transformers, Soybean Seed Damage, Visual Recognition
DOI
10.5703/1288284318735
SDAssessment: An Iterative Class-Weighted Composite Loss Framework for Automated Segmentation and Quantitative Assessment of Stinkbug-Damaged Soybean Seeds
Traditionally, soybean seed quality assessment relies on manual inspection using USDA grading sheets: a subjective, labor-intensive, and expensive process prone to human error. To address these limitations, this study builds a custom soybean seed dataset and introduces “SDAssessment”, a computer vision framework designed to automate the segmentation of multiple surface damage types (wrinkles, dark spots, and other damage) in soybean seed images. To address the severe class imbalance posed by highly localized and fine-grained damages, we propose a novel iterative class-weighted loss-tuning strategy paired with a composite loss function. A total of 11,502 damaged seeds were collected, and a custom-designed imaging system captured 1,278 images, each containing multiple seeds. We manually drew polygon annotations around the edges of wrinkles, dark spots, and other damages, and trained YOLO-based segmentation models (YOLOv8n-seg, YOLOv8m-seg, YOLOv11m-seg) to detect seeds. Using our tailored optimization framework, we evaluated seven segmentation architectures (U-Net, U-Net++, DeepLabv3, DeepLabv3+, SegFormer, and Swin-Base+UperNet) for multiple-damage segmentation on a dataset of 9,332 augmented images with 83,988 seeds. The best-performing models, YOLOv8n-seg and Swin-Base+UperNet, were used to assess seed quality. The YOLOv8n-seg model achieved 99.4% precision and 100% recall for seed detection in images. Among the segmentation models, Swin-Base+UperNet optimized with our composite loss strategy performed best, achieving Dice (F1) scores of 81.60% for wrinkles, 58.23% for dark spots, and 80.97% for the other damage category. The framework was deployed in a prototype web application to demonstrate its practical feasibility. This application allows users to upload seed images, isolate them, and automatically segment damage within each seed to quantify damage metrics (count, location, and area). Overall, this framework provides an alternative to manual seed inspection and may support future developments in automated seed sorting and grading.