Skip to the panels
Issue No. 142
Recipes & Cooking

Flipping Green Coffee Beans Boosts AI Defect Detection by 25.7%

Story by Daily Coffee News Staff · 831 readers

A Mexican research team found that photographing both sides of green coffee beans improved defect detection, though its prototype remains slow to process.

Flipping Green Coffee Beans Boosts AI Defect Detection by 25.7%

green coffee

A simple mechanical step produced the clearest gain in a new AI system for inspecting green coffee: turn each bean over. A research team in Mexico reported that photographing both sides improved defect detection by 25.7% compared with inspecting just one. That result points to a practical limit of image-based grading: a model can only assess the surface it sees.

Their findings appeared Aug. 21 in the journal Agriculture. The work focuses on a persistent inspection challenge: a defect on the hidden side of a bean can escape a camera, even when the image analysis itself performs well.

Two views address a basic blind spot

The system handles green coffee samples of 350 grams. A hopper and dispenser roller feed small groups of beans into view beneath controlled LED lighting. Two 16-megapixel cameras photograph the first side; a mechanical mechanism then rotates the beans 180 degrees so the cameras can capture the opposite side.

That sequence matters because software cannot identify a flaw that never appears in an image. A second view gives the model more surface information to assess, while the physical rotation makes the inspection repeatable. The study’s reported 25.7% improvement suggests that the image collection method can shape results as much as the choice of neural network.

The team assembled a 12-class image dataset: 11 defect types and a normal green-coffee category. The defects included sour, brocade, peaberry, shell, elephant, frozen, black, ear, broken, dry and triangle. Researchers started with expertly classified samples, then used data augmentation to expand the material to 9,600 images for training and evaluation.

Strong model results, with limits

Four neural-network models were assessed, and YOLOv8 came out on top, with 97.4% precision and 99.6% recall. Those measures describe different parts of a model’s performance: precision reflects how often its defect identifications are correct, while recall reflects how often it finds the relevant cases in the data. The figures are promising for this study, but they describe the tested dataset and setup; they don’t establish how the prototype would perform across every coffee, defect mix or operating condition.

The result also connects with 2024 research from Bangladesh and Japan, which found a customized YOLOv8n model effective for identifying green-coffee defects compared with other YOLO models. The new work adds a useful operational question to that line of research: even a well-performing model may benefit when the equipment presents it with a more complete view of each bean.

There’s a sizeable qualification. Processing a standard 350-gram grading sample took about 38 to 40 minutes. The researchers did not present the apparatus as a high-volume commercial optical sorter, and they cautioned that the comparison between one-sided and two-sided inspection used a limited sample. They called for tests with larger and more diverse samples.

What the prototype could mean for coffee assessment

For now, the work is best read as a demonstration of a promising inspection method, not a ready-made replacement for established sorting equipment. A processing time of that length would constrain throughput in many production settings. More testing would need to show whether the accuracy gain holds across broader samples and whether the two-sided approach can work at a useful pace in practice.

Still, the experiment highlights a design choice with broad relevance to automated grading: carefully controlling how an item is presented can improve what the model has a chance to detect. In this case, the added information came from mechanics rather than a more complicated camera arrangement or a different model. The finding invites a closer look at where beans remain hidden during inspection and whether a repeatable turn can expose the surface that matters.

AI tools for coffee analysis, sorting and quality assessment have also reached the market in recent years. Companies including Demetria, Avercasso and ProfilePrint have introduced products within the past five years, working at different stages of the coffee supply chain. The Mexican team’s prototype adds a research example to that expanding mix, with bean presentation at its center.

The study received funding through a Tecnológico Nacional de México grant, and its authors declared no conflicts of interest. Its practical takeaway is clear: when visual inspection misses a surface, turning the bean may give the algorithm a better chance to find what’s there. Larger, more varied trials will show how durable that advantage is.

Source: Daily Coffee News Staff · dailycoffeenews.com

Crossover stories