Computer vision for coffee quality
Exploring how machines can recognize visible defects in green coffee beans.
A research collaboration between Plexys and Professor Nen-Fu Huang’s team at National Tsing Hua University.
The inspection challenge
Specialty green coffee is inspected for visible defects before it moves further along. A camera only sees what the lighting and the bean’s orientation allow. Reflections can hide a mark, and a defective bean can look sound from the other side.
This research examines whether controlled imaging and a detection model can locate individual beans and distinguish those with visible defects. The aim is to support inspection and sorting of specialty green coffee, not to issue a full quality grade.
Building the right view
The research team used industrial vision equipment to photograph beans and compared nine lighting conditions to identify the clearest images. A white paper background helped address reflections encountered with a transparent container.
The dataset contained 35 photographs with 6,090 labeled bean instances. Using these annotations, the team trained a YOLOv8s object-detection model to locate beans and distinguish between the labeled categories of good and defective beans.
The process connected the model to the physical inspection task. Lighting and the way beans were presented to the camera directly affected the information available for assessment.
Testing the model on hardware
These results establish an initial research benchmark for visual inspection under the conditions studied.
Results documented in October 2024. Each reported detection evaluation covered six images containing 1,138 annotated bean instances. mAP@0.5 is an object-detection metric. Processing time includes image preprocessing, model inference, and postprocessing.
What this means for physical intelligence
The study highlights a practical requirement for machines working with natural products. The sensing setup has to expose the information needed for a useful decision. For green coffee, that decision is whether a visible defect is present.
For Plexys, this connects agricultural research to physical intelligence. We develop how a machine observes a material alongside how it interprets those observations, so it can support inspection and handling.
