RoastLearner for Artisan: train Artisan to listen to your roast

Discuss roast levels and profiles for espresso, equipment for roasting coffee.
luma
Posts: 77
Joined: 10 years ago

#1: Post by luma »

A few weeks ago I got a harebrained idea and I've since gone about putting together an initial attempt at turning the concept into reality. The result is something I'm calling RoastLearner, and version 0.0.1 is now available for download.

At it's simplest, RoastLearner allows your computer to "hear" the sounds of first crack while roasting with Artisan. RoastLearner uses a microphone to record the sound of your roast, provides a platform to train the sounds made during that process, and then runs the trained classifiers during future roasts to classify what it's "hearing" while sending the results to Artisan in (near) real time.

RoasterLearner is a series of scripts to record audio with SoX, feed the recording to pyAudioAnalyzer, and display the results in Artisan. The scripts are currently Windows-only and have undergone limited testing. There's also quite a bit of setup to do as I've yet to successfully compile pyAudioAnalyzer.py into something that is portable and performant. Still, I think the package is at a point where a novice user can deploy and use it. On my sample set of one it has been reliable and straightforward to use. I'm curious to hear what others think.



I've documented the setup process here. Follow the links to each guide in sequence to deploy the various components and to get a handle on how everything fits together. You'll need to run this setup through a roast or three to record data to train the classifiers. There's a manual step where you review the audio, then you'll run a script which will create the classifiers. The classifiers can then run with Artisan to display their results on the live graph.

It sounds like a lot of work but the only command-line stuff is during the installation and it's 100% copy-and-paste. The scripts themselves are fire-and-forget and you should not have to do any significant customization for your setup.

Go download it, get started, and tell us how it goes!

btreichel
Posts: 140
Joined: 8 years ago

#2: Post by btreichel »

Looks great, now I just need a roaster to run artisan on.

User avatar
farmroast
Posts: 1623
Joined: 17 years ago

#3: Post by farmroast »

:idea: nice possible solution for data of the crack profile. Useful for tweaking development profile.
LMWDP #167 "with coffee we create with wine we celebrate"

User avatar
AssafL
Posts: 2588
Joined: 14 years ago

#4: Post by AssafL »

Wow. Awesome job. When I do my next roast I'll give it a try.
Scraping away (slowly) at the tyranny of biases and dogma.

zachig
Posts: 10
Joined: 9 years ago

#5: Post by zachig »

WOW!!! Nice job!

I'll definitely give it a try (as soon as I find the time) on my newly restored TorreFattore 1KG Electrical Drum (Perforated) Roaster.

I'm wondering...is this software capable of detecting only 1st crack? Or also 2nd?

In case a more sensitive USB Microphone (Condenser?) will be used (rather than the cheap one you used), will it improve the detection?

Well done...I hope it gets improved. Keep us updated! THX!!! :D :wink:

User avatar
CoffeeBar
Posts: 644
Joined: 10 years ago

#6: Post by CoffeeBar »

btreichel wrote:Looks great, now I just need a roaster to run artisan on.


Me too :D

KingSmono
Posts: 20
Joined: 10 years ago

#7: Post by KingSmono »

This is too cool. 8) I wish I could use it, but my setup is a little odd. I have Artisan running on a Raspberry Pi which I then connect to over a VNC client app running on an iPad. But great idea and nice job turning it from an idea into an actual implementation!

luma (original poster)
Posts: 77
Joined: 10 years ago

#8: Post by luma (original poster) »

zachig wrote:WOW!!! Nice job!
Thanks! Just realized I never responded to the posts here so here goes.
zachig wrote:I'm wondering...is this software capable of detecting only 1st crack? Or also 2nd?
The training process is pretty general purpose, and in limited experiments I was able to train it to recognize things like the drum motor and the fans (not always doing so on purpose mind you.) Presumably it would also work to detect second crack. As I basically never roast to that point, collecting data on 2nd crack would require throwing a bunch of beans away which I've been reluctant to do.

Funny story about that: I've been helped out on occasion by the nice folks at Ferris coffee. For this project I approached them with a weird request: do you have any absolutely awful greens that you'd sell for cheap which I can roast to a crisp and record with a microphone so I can test some machine learning etc etc? I must have sounded like a nutter, but they obliged and dug up 20# of horrible Robusta for very little money. I took it home and fired up my HotTop to learn a few things. First, sh**ty Robusta beans are small and tend to fall directly through the holes in the drum pretty readily, leaving me with an overflowing chaff tray and a drum whose holes are stuffed full of charred black beans. Second, Robusta makes nearly no noise at all during second crack, certainly not enough to pick up a clear signal over the machine sounds.

Can I interest anyone in 19# of some quality Robusta?
zachig wrote:In case a more sensitive USB Microphone (Condenser?) will be used (rather than the cheap one you used), will it improve the detection?
Maybe? The USB mic is a condenser just because they are cheap and (generally) offer a flat response curve and high sensitivity. I wanted to avoid anything too exotic with hopes that others could replicate the results without spending a bunch of money on esoteric recording equipment. As it happens I do have a calibrated measurement mic and a reasonable pre-amp, but haven't bothered deploying that as I'm not terribly convinced it's going to improve things much. If I wanted a warm, natural sound then I could see spending $$$ on a nice dynamic mic, but for a flat response curve and high sensitivity condensers are just the ticket. It just so happens that they are also cheap :D

luma (original poster)
Posts: 77
Joined: 10 years ago

#9: Post by luma (original poster) »

KingSmono wrote:This is too cool. 8) I wish I could use it, but my setup is a little odd. I have Artisan running on a Raspberry Pi which I then connect to over a VNC client app running on an iPad. But great idea and nice job turning it from an idea into an actual implementation!
That actually sounds like an interesting arrangement and I hadn't considered using a remote display for control. I have Artisan compiled and running on an rPi with the 7" official touchscreen which is way to small for normal use.

I've been kicking around trying to port this all over to bash scripts as I can do so on Windows without a lot of trouble (yay Windows 10). This should let me run on an rPi but one will almost certainly run into performance problems. The way the software is setup scales well with varying performance, so running on a resource constrained platform should still work, only at lower resolution and with increased latency.

Due to some previous work I have NVIDIA committed to sending me some obnoxiously expensive Tesla cards, which will likely have me attempting to do all of this over again under Linux so I can setup GPU TensorFlow to create neural network versions of the work presented above. Because who wouldn't go and setup $5000 video cards that can't actually do video just to listen to their coffee roaster...