← All projects

AgriTech · Computer Vision · ML

AgSolaire — seed weight estimation

A non-invasive pipeline that weighs seed groups from a single high-resolution image — YOLOv5 detection, SAM2 segmentation, and nine morphological features feeding an XGBoost regressor.

ROLEML Engineer CLIENTAgSolaire STATUSDelivered
AgSolaire-ML pipeline: YOLOv5 detection, SAM2 segmentation, morphological feature extraction, and XGBoost regression

The challenge

Weighing without a scale

Seed-group weight had to be estimated non-invasively and automatically, from images alone.

Pixels don't weigh anything

Visual features strongly correlated with physical mass had to be found, measured, and validated.

Dozens of tiny subjects

Each frame holds a cluster of small seeds that must be isolated individually before measuring.

The approach

01

YOLOv5 seed detection

Per-seed bounding boxes at 99.8% precision and 98.9% recall — each box becomes an ROI.

02

SAM2 segmentation

Meta's SAM2 returns a pixel-accurate mask per seed — no task-specific training required.

03

Morphological features

Nine descriptors per seed — area, perimeter, length, width, circularity, elongation, IS, CG, DS — averaged per group.

04

XGBoost regression

The feature vector maps to predicted group weight, trained on samples with known weights.

Outcomes

99.4%

Detection mAP@0.5

YOLOv5 — 99.8% precision, 98.9% recall on seeds.

9 features

Morphology engine

Geometric descriptors computed from SAM2 masks.

69.15%

Within ±0.1 tolerance

139 of 201 test samples — MSE 0.0095.

Stack YOLOv5 SAM2 XGBoost Python Feature engineering Morphometrics Regression