Machine Learning In The Kitchen Makes For Tasty Mashup Desserts – Hackaday

Machine Learning In The Kitchen Makes For Tasty Mashup Desserts – Hackaday

What did you do during lockdown? A whole lot of people turned to baking in between trips to the store to search for toilet paper and hand sanitizer. Many of them baked bread for some reason, but like us, [Sarah Robinson] turned to sweeter stuff to get through it.

The first Cakie ever made. Image via Google Cloud

Her pandemic ponderings wandered into the realm of baking existentialist questions, like what separates baked goods from each other, categorically speaking? What is the science behind the crunchiness of cookies, the sponginess of cake, and the fluffiness of bread?

As a developer advocate for Google Cloud, [Sarah] turned to machine learning to figure out why the cookie crumbles. She collected 33 recipes each of cookies, cake, and bread and built a TensorFlow model to analyze them, which resulted in a cookie/cake/bread lineage for each recipe in a set of percentages. Not only was the model able to accurately classify recipes by type, [Sarah] was able to use the model to come up with a 50/50 cookie-cake hybrid recipe. The AI delivered a list of ingredients to which she added vanilla extract and chocolate chips for flavor. From there, she had to wing it and come up with her own baking directions for the Cakie.

From the Data Table to the Kitchen Table

In December 2020, [Sarah] teamed up with [Dale Markowitz], an Applied AI Engineer for Google to build version 2.0 of the recipe predictor. They also came up with a cookie-bread hybrid recipe that they’re calling the Breakie.

This time, they made a bigger dataset by collecting about 600 recipes. In order to level the playing field, they whittled all the recipes down to 16 essential ingredients: yeast, flour, sugar, egg, fat (any type of oil), milk, baking soda, baking powder, apple cider vinegar, buttermilk, banana, pumpkin puree, avocado, water, butter, and salt.

Feature importance of the essential ingredients in baked goods. Image via Google Cloud

The point was to include ingredients that affect texture and consistency and leave out the ones that don’t, like cinnamon. They also converted everything to ounces and shuffled a few items around, mainly moving recipes like banana bread and pumpkin bread into the cake category (where they belong).

This time, the model had explainability baked in. Explainability in machine learning amounts to making models more interpretable, and understanding why they make the predictions they do. This is the meat and potatoes of finding out what delineates cookies from cakes from breads. [Sarah] and [Dale] used Google’s AutoML Tables, which is a no-code machine learning tool that builds models based on tabular data. They fed in a CSV file and did the same thing as before — AutoML analyzed the ingredients of each recipe and judged them as cookies, cake, or bread based on the ingredients and their amounts.

One of the nifty things AutoML does is to compute ‘correlation with target’. Here, the target is whichever baked good they are trying to predict: cookie, cake, or bread. The biggest predictors of each category turned out to be the amounts of butter, sugar, yeast (if any), and egg. To this amateur baker, these results are interesting but not totally unexpected — the more eggs a recipe has, the more likely it is to be cake. And have you ever made cookies or cake with yeast? It’s not completely unheard of, but it’s not really the norm for those, either.

Baking for Science: the Cakie

I was so intrigued by these AI-created dessert mashups that I had to try them. I fired up the oven in the Hackaday test kitchen and got to baking. For the first experiment, I decided to make the cake-cookie hybrid recipe, because it sounded slightly more delicious than ‘bread-inspired cookies’.

The dessert you didn’t know you needed — a perfect cross between chocolate chip cookies and cake. Image via Food & Wine

I followed the recipe as closely as possible and used room temperature butter. After doing some research, I decided to leave the egg out on the counter as well. My research indicated that the butter should be about 65 °F (18.33 °C), and it took around four hours for the butter to warm up to usable temperature.

One thing I did change was the pan. Who has a 6″ cake pan, anyway? Not me. I couldn’t even find a foil version at the grocery store, so I used a single 9″ round non-stick cake pan instead, and greased it as indicated. I thought 25 minutes sounded a bit too long, so I started with 20 minutes and then added two minutes when my toothpick didn’t come out clean. That turned out to be pretty spot on, so if you’re going to make these (and you definitely should), go for about 22 minutes in a 9″ round pan. Trust the toothpick test.

Once the cakie had been out of the oven for about ten minutes, I dug in. As you can see, it crumbles like a cookie and has a flaky top layer that is ever-so-slightly grainy from the sugars. I think it tastes amazing and my husband agrees. It tastes like an exact cross between cookie and cake, and somehow manages to have the mouthfeel of both. When I went back later for more, it held together much better.

Them’s the Breakies

“Bread-inspired cookies” is better than it may sound. Image via Google Cloud

The next day, I made the breakies. Following the previous day’s success, I put my butter and egg out on the counter at 9:00 AM and I started baking around 1:15 PM.

There’s a little more to this recipe, which is clearly divided into ‘the bread part’ and ‘the cookie part’ as you can see in the directions. Although if you think about it, chocolate chip cookies are made the same way — you combine the dry ingredients in a separate bowl and gradually add it to a creamed mixture of butter, brown sugar, white sugar, eggs, and vanilla. The breakies come together much the same way, though the dough ended up quite thick — much more bread-like than cookie-like.

[Sarah] and her breakies. See how poofy they are? Image via Google Cloud

I said it to myself going in, and I stand by it after eating these breakies– yeast does not belong in cookies. There’s a reason cookies use baking soda to rise instead, like a quick bread. It’s not that I can taste the yeast in them, but I think it definitely affects the texture.

All of that said, the breakies taste pretty good. They have the mouthfeel of an oatmeal raisin or a sugar cookie — very textured. I found the yeast difficult to dissolve in in the prescribed amount of milk, and that’s likely why mine didn’t rise as impressively as [Sarah]’s. It also may have something to do with the milk I used, which has lactase enzyme added to it for the lactose-intolerant. Or maybe I didn’t heat it up enough in the microwave.

Much like the cakie, the warm breakies sort of fell apart, but cooled breakies stay together much better. I had one fresh out the oven (as you do), and I think I prefer them cooled. Now, they have a sort of crisp outer shell to bite into.

All in all, I would say this experiment was a success. I think that ultimately we can and should trust AI to give us tasty mashup desserts, if nothing else. I for one would be interested in experimenting even further by throwing pie recipes in the mix. Pudding cookies are delicious, so why not pie cookies?


Leave a Reply

%d bloggers like this: