Coffee Data Science

How to Image Individual Coffee Beans?

The start of an investigation

Robert McKeon Aloe
3 min readJan 23, 2024

As I have been ramping up on my coffee roasting experiments, one tool that I think is very helpful is evenness of coffee bean color. This can be measured with a tool, but these tools give a higher level average. I’m unsure if more detailed analysis would help.

So I have started to explore a few ways to measure the individual coffee bean color. The first thing about measuring coffee color is that the bean orientation is very important. Using something like Syncfo or Omni doesn’t specify bean orientation, but would this be useful?

Tiger stripes on coffee beans.

These beans have dark spots because of added moisture, but I suspect this means the bean is unevenly roasted.

I could orient the beans in a pattern like this:

The benefit of the beans being spread out is that an algorithm could easily segment them. However, the lighting could be more uneven.

I could tighten the pattern, but again, there could still be some light source challenges. I suspect I need a light box.

I thought about something more simple for measuring with the Omni. The lighting is more even, but this could be more challenging to cleanly segment in an algorithm.

All of these have a sample size issue too. I suspect I might have to pick some good samples and bad samples on purpose or do both random and special selection.

This type of detailed color analysis may not help me better understand coffee roasting, but it is a low effort on my part because of my technical background. I’m curious what others have done in the area.

If you like, follow me on Twitter, YouTube, and Instagram where I post videos of espresso shots on different machines and espresso related stuff. You can also find me on LinkedIn. You can also follow me on Medium and Subscribe.

Further readings of mine:

My Second Book: Advanced Espresso

My First Book: Engineering Better Espresso

My Links

Collection of Espresso Articles

A Collection of Work and School Stories

--

--

Robert McKeon Aloe

I’m in love with my Wife, my Kids, Espresso, Data Science, tomatoes, cooking, engineering, talking, family, Paris, and Italy, not necessarily in that order.