← return to matrix

// COMPUTER VISION

Coffee Ripeness Detection

Custom 3,000+ image dataset and YOLO-based detection model for precision agriculture in Chikkamagaluru.

YOLORoboflowPythonOpenCVPyTorch

Overview

Curated a custom 3,000+ image dataset from coffee plantations in Kalasa, Chikkamagaluru, capturing real-world variation in lighting, occlusion, and plant structure. Trained a YOLO object detection model for multi-class detection of ripe vs. unripe coffee cherries and leaf structures.

Problem

Manual inspection of coffee cherry ripeness is labour-intensive and inconsistent across large plantations. Automated detection enables targeted picking, reducing waste and improving yield quality. The primary challenge is building a robust model from scratch without any existing domain-specific datasets.

Dataset Context

Name

Kalasa Coffee Plantation Dataset (Custom)

Metadata Matrix Size

3,000+ high-resolution images

Telemetry Source

Field collection — Kalasa, Chikkamagaluru, Karnataka

Pipeline Preprocessing Steps

  • »Multi-class bounding box annotation via Roboflow: ripe cherry, unripe cherry, leaf
  • »Data augmentation: horizontal/vertical flip, brightness jitter, mosaic, random crop
  • »Train/val/test split: 80/10/10
  • »Roboflow export in YOLO format

Architecture & Technical Foundation

Model Architecture

YOLOv8 (fine-tuned)

Technology Stack

Ultralytics YOLOv8 + PyTorch

Key Components

  • YOLOv8n/s backbone fine-tuned for domain adaptation
  • Roboflow-managed annotation and augmentation pipeline
  • Multi-class detection: ripe cherry, unripe cherry, leaf structure
  • Mosaic augmentation for robustness to occlusion

ML Pipeline

01

Field Data Collection

3,000+ images captured from Kalasa plantation across varied lighting and angles.

02

Annotation

Multi-class bounding box labeling using Roboflow annotation tool.

03

Augmentation

Roboflow-based augmentation pipeline: flips, brightness, mosaic.

04

Fine-tuning

YOLOv8 fine-tuned from COCO weights on custom dataset.

05

Evaluation

mAP, Precision, Recall evaluated on held-out test split.

06

Inference

Real-time detection pipeline for plantation field use.

Results & Outcomes

3,000+

Dataset Size

6

Classes

81.0%

mAP

72.4%

Precision

78.7%

Recall

75.4%

F1-Score

  • First custom coffee ripeness dataset from the Chikkamagaluru region
  • Multi-class annotation strategy improves contextual understanding via leaf structure detection
  • Robust to natural environmental noise, varying camera angles, and occlusion