Benign InnovationsCompany & role details

Grass Quality Segmentation

Weak grass-quality labels are refined with OpenCLIP, used to train a ResNet-18 patch classifier, and reconstructed into overlapping-window quality heatmaps.

Owner-provided grass-quality summary with a lawn image, an illustrative heatmap, weak labels, OpenCLIP relabeling, multiscale patches, ResNet-18, and overlapping predictions.
Project summary illustration

Tools & Skills

  • Weak Supervision
  • OpenCLIP
  • ResNet-18
  • Patch Classification
  • Segmentation
  • SEEM
  • SAM2
  • ViT
  • CNN
  • Heatmap Generation
Outcome
Overlapping patch predictions produce local grass-quality heatmaps.

Local grass-quality estimates

I developed a visual quality-mapping workflow for lawn imagery, using weak supervision to train a ResNet-18 patch classifier. Local predictions are combined into a heatmap so different areas of the same lawn can receive different quality estimates.

The labels describe visible good/bad appearance. They are not measurements of soil chemistry, moisture, or plant disease.

Turning weak labels into patch supervision

The preparation pipeline uses SEEM and SAM2 to identify grass and dirt regions. Grass receives an initial quality label from the collection’s good/bad designation or manual configuration; dirt is marked bad, and unrelated classes are ignored.

The patch generator takes crops fully inside labeled polygons at 64, 128, and 256 pixels, then resizes them to 64 × 64. This gives the classifier a fixed input size while sampling different spatial contexts.

OpenCLIP ViT-B-32 compares each patch with good- and bad-grass text descriptions. If the opposite class receives a softmax score greater than 0.85, the script changes the seed label; otherwise it keeps the original label. This is a relabeling rule, not an 85% accuracy claim or a guarantee of calibrated confidence. Patches, labels, and source filenames are stored in NPZ datasets.

Patch classification and heatmap assembly

The selected classifier uses a ResNet-18 backbone with a two-class output head. Training applies image augmentation, ImageNet normalization, cross-entropy loss, and AdamW optimization.

The dense demonstration runs 64 × 64 windows at stride 16. Each window contributes its bad-quality probability to the covered pixels. Overlapping contributions are averaged and smoothed to form the displayed heatmap; a configurable threshold can turn the map into a binary region estimate.

This reconstruction provides finer spatial coverage than a single whole-image score, while its effective resolution still depends on patch size and stride. A separate ground-truth generation utility uses a smaller stride and converts thresholded grass-region predictions into polygon labels for further segmentation experiments.

Engineering value

The workflow connects weak collection labels, text-guided relabeling, compact supervised learning, and spatial visualization. It reuses the annotation infrastructure from the instance-segmentation pipeline while addressing a different target: local grass appearance rather than object identity.

The linked demonstration shows the resulting quality predictions and heatmaps on lawn imagery.

Evidence & demonstration

Demos & project media

Grass-quality segmentation and heatmap output on lawn imagery.

Project diagram

100%Drag or scroll to explore

Project image

Click outside the image or press Escape to close.