Author Archives: Sara Robinson

Baking up the future with Mars Wrigley & Cloud AI

Baking is something that I like to do to relax; spending leisurely evenings creating something beautiful with as much care and precision as possible. Baking with AI—blending my day job as a machine learning engineer with one of my favorite hobbies—makes this experience even better. Plus, the serendipitous nature of building the model, arriving at a new and unique recipe and then testing it in the kitchen, is incredibly fun.

So, when legendary confectioner Mars Wrigley approached us for a Maltesers + AI kitchen collaboration, I jumped at the chance. Maltesers are a popular British candy made by Mars. They have an airy malted milk center with a delicious chocolate coating.

Like so many others, I jumped on the baking bandwagon during the pandemic and baked up a storm throughout 2020. According to Google Search Trends, in 2021 people searched for “baking” 44% more when compared to the same time last year. You might even say the trend continues to rise.

But what were people actually searching for in the UK and could it inspire a new recipe for Mars Wrigley? I discovered that one of the top searched questions recently regarding “sweet and salty” was “Is Marmite sweet or savory?” Knowing how popular Marmite is in the UK, I decided it must be included in my newest creation. My goal was to use machine learning to create the base recipe for this dessert, and then find tasty ways to incorporate both Maltesers and Marmite.

I created a new machine learning model and fed it hundreds of existing recipes for cakes, cookies, scones and traybakes. After the model learned the combinations of ingredients that make up these baked goods, I had it generate recipes for each of them. Unlike most ML models, this one required testing in the kitchen to make sure the ingredient combinations generated by the model produced baked goods you’d actually want to eat. Picture me and my laptop in a cloud of flour, tasting batter and frosting, and eating way too many Maltesers along the way.

Delicious Maltesers® AI Cakes (4d6172730a)

Maltesers® AI Cakes

I’m skipping a lot of the ML magic! For a technical deep dive on how the AI works, see this blog post. For baking enthusiasts, these pictures share a little more of the process. Midway through baking the cake, I added three surprise Maltesers in the middle, and a cookie layer on top (which becomes the bottom when you flip these out). Yum!

Where’s the Marmite, I hear you say!? I whipped up a Marmite-infused buttercream topping. It’s delicious! Don’t believe me? See the recipe below, give it a whirl and let me know what you think. Share photos on Twitter or Instagram using the hashtag #BakeAgainstTheMachine, and head over to BakeAgainsttheMachine.co.uk to learn more about this project from Mars and find more special Maltesers recipes. I can’t wait to see your creations!


Recipe for Malteser AI cake
Recipe for Malteser AI cake 2


Just desserts: Baking with AI-made recipes


It’s winter, it’s the holidays and it’s quarantine-times: It’s the perfect recipe for doing a ton of baking. In fact, U.S. search interest in "baking" spiked in both November and December 2020.

But being in the AI field, we decided to dive a little deeper into the trend and 

try to understand the science behind what makes cookies crunchy, cake spongy and bread fluffy — and we decided to do it with the help of machine learning. Plus, we used our ML model to come up with two completely new baking recipes: a cakie (cake-cookie hybrid) and a breakie (bread-cookie hybrid). (Don’t worry, recipes included below.)

We started off by collecting hundreds of cookie, cake and bread recipes. Then we converted all of their ingredients to ounces and whittled them down to a few essential ingredients (yeast, flour, sugar, eggs, butter and a few other things). Next we did a bit of reorganizing, since according to Paul Hollywood, treats like banana, zucchini and pumpkin bread are really more cake than they are bread.

Then we used a Google Cloud tool called AutoML Tables to build a machine learning model that analyzed a recipe’s ingredient amounts and predicted whether it was a recipe for cookies, cake or bread. If you’ve never tried AutoML Tables, it’s a code-free way to build models from the type of data you’d find in a spreadsheet like numbers and categories – no data science background required. 

Our model was able to accurately tag breads, cookies and cakes, but could also identify recipes it deemed “hybrids” — something that’s, say, 50% cake and 50% bread, or something that’s 50% cake and 50% cookie. We named two such combinations the “breakie” (a bread-cookie — "brookie” was already taken) and the “cakie” (a cake-cookie) respectively. 

Being science-minded bakers, we had to experimentally verify if these hybrid treats could really be made. You know, for science.

Behold the cakie: It has the crispiness of a cookie and the, well, “cakiness” of a cake.

Image showing a cake-like cookie with a slice cut out of it.

We also made breakies, which were more like fluffy cookies, almost the consistency of a muffin.

Image showing a woman with dark brown hair looking into the camera while holding up a tray of puffy-looking cookies, which are actually bread-like cookies.

Sara's first batch of breakies.

Beyond just generating recipes, we also used our model to understand what made the consistency of cookies, cakes and breads so different. For that, we used a metric called  “feature importance,” which is automatically calculated by AutoML Tables.

In our case, the amount of butter, sugar, yeast and egg in a recipe all seemed to be important indicators of “cookieness” (or cakiness or breadiness). AutoML Tables lets you look at feature importance both for your model as a whole and for individual predictions. Below are the most important features for our model as a whole, meaning these ingredients were the biggest signals for our model across many different cake, cookie and bread recipes:

A chart showing the feature importance of items like butter, sugar, yeast, egg, and so on in each of the recipes.

If you find yourself with extra time and an experimental spirit, try out our recipes and let us know what you think. And you can find all the details of what we learned from our ML model in the technical blog post.


A recipe card for a cakie.
A recipe card for a breakie.

Most importantly, if you come up with an even better cakie or breakie recipe, please let us know.