Coffee Data Science

Espresso Puck Analysis from the Bottom

Post-shot analysis to read the espresso tea leaves

Robert McKeon Aloe
Towards Data Science

--

The way I pull espresso shots could be described as a vortex of data collection. What started out as a few variables expanded to include imaging the bottom of the pucks. This has been helpful for certain types of shot diagnostics for localized channeling, but I was curious how strongly image details align with taste and extraction.

A fair share of people will post the top of their puck after the shot online and ask for feedback. The top of the puck is not so useful, but I have found the bottom of the puck can be revealing to part of how the water flowed.

I have seen from experience that fewer dark spots mean less channeling as dark spots are usually indicative of low flow to those areas, thus higher flow to others and channeling.

Some dark spots are surface deep, and some continue all the way through. The more dark spots, the more uneven water flowed through the puck.

Data

I’ve been taking photos of the bottom of the puck for a few months, so I grabbed a bunch of images and aligned them with my data sheet. I ended up with 175 images with data in the data sheet.

All images by author

I tried to keep the lighting consistent, but usually there were some lighting artifacts. Otherwise, it was a quick piece of information to capture.

Metrics of Performance

I use two metrics for evaluating the differences between techniques: Final Score and Coffee Extraction.

Final score is the average of a scorecard of 7 metrics (Sharp, Rich, Syrup, Sweet, Sour, Bitter, and Aftertaste). These scores were subjective, of course, but they were calibrated to my tastes and helped me improve my shots. There is some variation in the scores. My aim was to be consistent for each metric, but some times the granularity was difficult.

Total Dissolved Solids (TDS) is measured using a refractometer, and this number combined with the output weight of the shot and the input weight of the coffee is used to determine the percentage of coffee extracted into the cup.

Preparing the Images

First, I needed to prepare the images to make processing them easier. I did this by manually annotating each photo with a blue ring. I used this ring to define the area of interest, and I blacked out everything else.

I was then able to throw out any missing pieces and clearly see the puck.

I started processing them by exploring the Hue, Saturation, and Intensity (HSI) space. In the image below, this space is represented as Red, Green, and Blue (RGB). The dark spots had a noticeable shift in this image in the hue plane as well as the intensity plane.

Hue and Saturation seemed very interesting on their own:

Hue and Saturation

I normalized the image by the average intensity, and then I looked at some circular cuts for these planes. I looked at each ring individually as well as combined.

Correlation

Correlation is a metric to say how similar two variables are to each other. High correlation doesn’t mean one variable causes another variable, but that both variables go up or down the same when things change. I would assume from the start that some grading variables would have a high correlation because they are looking at taste from different points in time.

Looking at multiple metrics for Mean and STD for these rings on the saturation plane, I didn’t find anything with a stronger correlation than -25% which is pretty low. For reference, the correlation between taste and EY is usually around 70%. I also didn’t find a strong correlation for the hue or intensity planes, and the best correlation was in saturation.

To breakdown the data a bit, I used a metric I record for how the shot looks. I describe the shot flow as being centered, eccentric, tiny donut, donut, uneven, or one-sided. The majority of these shots were centered, eccentric, or tiny donut, and here are some examples below:

Centered, Eccentric, and Tiny Donut

This descriptor is a bit subjective, but I wanted to record something simple. My best shots are centered or eccentric, but this is the first time I have used this metric during data analysis.

Here are some of the standout metrics, which are all STD metrics. Centered and eccentric shots have a very low correlation (abs < 10%). However, the tiny donut shots have a much stronger negative correlation especially for taste.

I did a scatter plot of the Cumulative Outer Ring 3 which is the three largest rings combined:

There seems to be some pattern, but there is not a strong linear fit. I suspect tiny donut is different than centered or eccentric since those shots have very little noticeable slow spots (dark spots on the puck). Their final extraction is a bit more nuanced for what could cause it to be a little higher or lower than another shot.Tiny donut shots almost always have a lower extraction and a more uneven extraction.

This study did not show strong correlation between the bottom of the puck and the performance metrics. I know from experience that the bottom of the puck is a helpful guide towards debugging a shot, and it is quite possible that I did not have enough data to see something more interesting.

--

--

Responses (1)