U-Net Framework for Micro-Scale Surface Damage Segmentation in High-Resolution Soybean Seed Imagery
Accurate detection of surface-level seed damage is critical for soybean seed quality assurance, yet automated micro-scale damage detection in high-resolution imagery remains an open challenge due to extreme spatial variability in damage scale, severe class imbalance across damage types, and the computational demands of processing ultra-high resolution agricultural imagery at scale. This research addresses the semantic segmentation of fine-grained soybean seed surface defects, such as wrinkles, dark spots, and general surface damage, in 6048 × 4024 pixel images where target damages can be as small as 18 × 18 pixels, using an augmented dataset of 77,000 individual seed images.
To overcome the difficulties of micro-scale detection, spatial sparsity, and class confusion, we propose a two-stage training and dual model inference framework built on an optimized U-Net architecture with a ResNet34 encoder. In the first stage, a damage specialist model is trained using weighted loss functions and a class-balanced approach that prioritizes damage classes.
In the second stage, transfer learning is applied to initialize a healthy seed specialist model from Stage 1 weights, with rebalanced class weights and tile probabilities that identify healthy seeds. During inference, a confidence-gated damage filter suppresses low-confidence predictions, and healthy seed labels are assigned only when the specialist model's confidence exceeds that of the damage model.
The two specialist models achieve validation accuracies of 94% and 98.53%, respectively, and the combined inference system successfully detects and localizes all three damage categories across unseen test images under conditions of extreme spatial variability and class imbalance. Qualitative evaluation confirms close alignment of predicted boundaries with ground truth annotations across all damage types, including dark spots.
These results demonstrate that confidence-gated dual model inference can reduce class confusion in imbalanced micro-scale segmentation, advancing the feasibility of fine-grained automated seed quality inspection at the scale.