Can First Crack Be Predicted? —— Challenging the Tipping Point of Roasting with Complex Systems Physics and AI


Aillio Bullet R1 V2

Over the past few years, having started with a hand roaster, I purchased a compact home roaster, Aillio (Aillio Bullet R1 V2), last year and have been roasting coffee beans. All the data and logs used for the verification in this article are derived from this Aillio Bullet R1 V2.

While Aillio has its own dedicated roasting log app, RoasTime, I switched to the more customizable Artisan and discovered that I could stream roasting logs in real-time via Websocket. This seemed very interesting, so I decided to build a live roasting app that visualizes the logs sent via Websocket in real-time.

With AI being so prevalent, simply visualizing roasting logs in real-time isn’t quite enough. So, I also implemented an experimental feature to see if AI could detect the underlying signs of the first crack.

Chaos Theory Meets Roasting: CSD (Critical Slowing Down) Theory

In coffee roasting, the “first crack,” where the cellular structure of the bean breaks down and moisture vaporizes, is a phenomenon as volatile as an untamed horse, accompanied by rapid thermal changes. As I began to understand the importance of temperature management around the first crack, I wondered if its timing could be predicted.

When I asked Gemini about it, it suggested the CSD (Critical Slowing Down) theory, a concept used in complex systems science such as meteorology and ecology. It sounded fascinating.

According to CSD theory, “just before a system undergoes a sudden change (phase transition), a delay in recovery, where the system struggles to return to its original state, occurs.” I can overlay this concept onto the phase transition leading up to the first crack in the roasting process.

Catching the Signs: Autocorrelation and Variance

To quantify this “delay in recovery,” our system primarily monitors the following two indicators in real-time:

  1. AR(1) Autocorrelation: The slowing down of state recovery, marked by an increase in the degree to which the immediate past state is carried over.
  2. Rolling Variance Calculation: Detecting the phenomenon where the “fluctuations” of the entire system become larger.

The moment these indicators exceed a certain threshold, an alert is triggered, signaling that the roasting tipping point is near.

Verification Data: Backtesting with Past Logs

As a result of backtesting using dozens of accumulated past roasting logs (.alog, etc.), I’ve seen that this CSD algorithm can detect a clear sign with decent accuracy, 30 to 120 seconds before the actual first crack occurs (lead time). Also, Claude analyzes the data instantly, which is incredibly convenient.

Although the lead time varies depending on the bean’s moisture content and batch size, it provides a sufficient time buffer to prepare yourself that “it’s going to crack soon.”

Current Status: Still Just the Beginning

While the backtesting showed promising results, I am still very much in the experimental stage. I want to continue roasting to find the perfect balance.


You can view the live roasting app here: ☕️ ARIGATO COFFEE ROASTERY

Related Posts

1ハゼは「予測」できるか?——複雑系物理学とAIで挑む焙煎の臨界点

ARIGATO COFFEE: 1ハゼ予兆検知機能。CSD(臨界減速)理論とAIを用いて、焙煎の臨界点をデータで予測できるのか

チームでボールを投げあうに至った話

Shopify Partyなるものを見かけて感激したところからはじまった

さっそくAWS LambdaをRubyで触ってみる

AmazonからLambdaでRubyをサポートするアナウンスがあったので早速試してみる

It describes Blockchain with minimum line.

I'm going to write Blockchain in Ruby, inspired by Naivechain

Dappプログラマへの最初の一歩

プラットフォームとしてのEthereum

最小コードでBlockchainを表現する

Naivechainを参考にRubyでかいてみる

ここ1年ちょっとを振り返ってみる

バンクーバーでの過ごし方、学校それに仕事とか

How I met Kyoto, part 2

The man who I met in Tarocafe was so mysterious and acatalepsy for me.

I wanna introduce cafes where You should go in Kyoto.

There are my favourite cafes in Kyoto.

How I met Kyoto

You should have one or more experiences that changes your life. in a better way