I have what I consider to be a rational and healthy skepticism toward the encroachment of artificial intelligence into our everyday lives. A powerful tool that has the potential to make life better for all of humanity, AI’s primary purpose thus far seems to be within the realm of bad art, hacky gimmicks, and increasing company profitability via reduced labor costs. Those who AI should be helping are the ones who find themselves out of jobs; no one in the C-Suite appears all too concerned about automation taking their paycheck when in fact it seems like there are some real costs that can be cut by allowing those executive-level decisions to be done literally soullessly.
Still, AI has the capacity to make things better. And in the coffee world, one promising novel use of AI comes in the detection of green coffee and classification of defects.
In a new study, published recently in the journal Scientific Reports, researchers sought to examine if YOLO (You Only Look Once), a deep learning model that detects objects in a still image or video, could effectively identify and classify green coffee. To do this, the researchers us a variety of YOLO variants and trained them on a image bank of 4,000+ pictures “encompassing diverse bean types, defects, and lighting conditions.”
They found that their custom version of the YOLOv8n model—” specifically designed for detecting defects in coffee”—performed the best across all metrics, with a 97.7% precision rate (the percentage of “true positives”, ie green coffee, the algorithm detected to all instances of green coffee detection), a recall of 99.9% (“the probability of accurate detection of ground truth objects,” in this case green coffee), as well as an f1-score of 98.3% (a combination of the first two metrics).
The algorithm was not only able to determine what was green coffee from an image but was able to accurately identify the four different defect types—black, broken, fade, and sour—it had been trained on.
YOLO models have previously been used to successfully identify apple blossoms, tomatoes, cherries, and apples, but had yet to be applied to coffee production. But the potential benefits are significant. Consistency is coffee production and the ability to remove defects are important factors in increasing a cup score, thus fetching a higher price for the crop. The researchers note that emerging production markets like Bangladesh could benefit a great deal from AI, “where it could significantly boost the economy and improve the livelihoods of farmers.”
This is perhaps the ideal implementation of artificial intelligence. Performing a time-intensive, near-impossible-for-humans task to provide an added overall value. It isn’t trying to replace the artist or the barista or the producer or any of the other very human parts of the ledger. It’s a tool allowing them to be more effective at their job.
Zac Cadwalader is the managing editor at Sprudge Media Network and a staff writer based in Dallas. Read more Zac Cadwalader on Sprudge.