Computer vision · ONNX Runtime · FastAPI

Roast classification and defect detection for coffee beans

Upload a coffee bean photo and choose green or roasted analysis (or let BeanSight choose automatically). The app uses a 17-class classifier for green (unroasted) beans, or a YOLOv8 detector that finds broken, quaker and scorched beans in roasted coffee.

Upload a photo

JPG · PNG · WEBP · up to 10 MB
Drop an image here or browse
A clear, well-lit photo on a plain background works best
Bean type

The roast classifier decides which defect model runs. If it gets the bean type wrong, pick it here and analyze again.

  • Green (unroasted) beans: photograph a single bean — the defect classifier was trained on individual beans.
  • Roasted beans: one bean or a handful — the detector draws a box around each bean it finds.

Results

Results will appear here after you analyze an image.

How it works

Three ONNX models run on CPU. Choose the green or roasted defect workflow, or use the roast classifier for automatic routing.

1

Roast level

An EfficientNet-B0 classifier labels the bean as Green, Light, Medium or Dark. The result is shown and, in auto-detect mode, selects which defect model runs next. You can override it.

Model
EfficientNet-B0
Classes
4
Input
224 × 224
2A

Green bean defect classifier

For unroasted beans, a second EfficientNet-B0 classifies the bean into one of 17 defect classes such as Full Black, Fungus Damage, Insect Damage, Parchment or Withered. Works on a single bean per photo.

Model
EfficientNet-B0
Classes
17
Scope
Single bean
2B

Roasted bean defect detector

For roasted beans, a YOLOv8n detector locates every bean and tags each one as Normal, Broken, Quaker or Scorched, so it handles a single bean or a handful at once.

Model
YOLOv8n
Classes
4
Scope
One or many beans

Models were trained on public coffee bean datasets and exported to ONNX; accuracy is best on photos that resemble the training data (a single bean on a plain background for classification). Predictions are informational and not a substitute for a certified grader.

Recent activity

Every analysis is logged to PostgreSQL; the uploaded image is stored in Supabase Storage.

Images analyzed—
Avg. inference time—
Green / roasted—
Models loaded—

Recent analyses

Last 20
Image Roast Defect result Confidence Time
Loading…

Defects found so far

Loading…