Download
Smart cookie! AI helps Google staff develop recipes for hybrid pastry
Nadim Diab
Why have cupcakes when you can try cakies? /CFP

Why have cupcakes when you can try cakies? /CFP

Recipe development is an art, but what happens when a data scientist takes on an ambitious baking project? Here's a hint: hybrid bakes.

The world is in no short supply of two-in-one pastries from the proissant, the love child of a pretzel and a croissant, to the cronut, a croissant-doughnut crossbreed. But unlike their baked buddies, the newest additions to the list – cakie and breakie – are part culinary curiosity, part data crunching.

The concoctions result from baking with the help of machine learning, two interests of Sara Robinson, a developer advocate on Google Cloud. During quarantine, as the world turned to the kitchen for solace and sustenance, Robinson was baking a storm, making cupcakes, sourdough bread, pizza, the works.

In their most basic forms, doughs and batters require a combination of some or all of the following: flour, liquid, sugar, fat, salt, egg and a leavening agent. Different ratios yield different baked items, and Robinson wanted to know whether machine learning could unpack these patterns and then predict the outcome of recipes based on their list of measured ingredients.

She was interested in three popular baked treats: loaves of bread, cookies and cakes.

Robinson first gathered a trove of online recipes, initially 99, then later some 600 with the help of Dale Markowitz, an AI Engineer also at Google. They spent time parsing through the ingredients, keeping core ones, and removing those whose absence won't affect the texture and consistency. "We didn't include anything [...] like cinnamon, chocolate chips, or nutmeg," the AI experts wrote in a blog post on Google Cloud Platform.

They also took out substances that might make the job of the baking prediction model easy. "You could theoretically add chocolate chips to any recipe, but they're almost never found in bread, a hint we didn't want our model to learn from," they explained. They ended up with 16 ingredients running the gamut from the usual suspects of baking – flour, milk and yeast – to less obvious choices like avocado and apple cider vinegar.

L-R: A cakie is a crossbreed of a cake and a cookie, while a breakie is a bread-cookie hybrid. /Sara Robinson

L-R: A cakie is a crossbreed of a cake and a cookie, while a breakie is a bread-cookie hybrid. /Sara Robinson

The duo also had to make sure that recipes were labeled correctly and different measurements were converted to a single unit. "We did a bit of reorganizing, since according to [The Great British Bake Off judge] Paul Hollywood, treats like banana, zucchini and pumpkin bread are really more cake than they are bread," the wrote in another entry.

They fed a Google-powered machine learning tool all their data, told it what to analyze, let it train for hours, then built an app for it. In a later taste test, the model correctly identified recipes for pieces of bread, cookies and cakes with different confidence rates based only on ingredient amounts.

According to the tech-savvy cooks, the software generally depended on the values of four ingredients to guess what's baking. "The amount of butter, sugar, yeast and egg in a recipe all seemed to be important indicators of 'cookieness' (or cakiness or breadiness)," they wrote. Less crucial to the predictions were the baking powder, milk and avocado.

But the software is no one-trick pony. It not only could guess recipes but also helped generate new ones. The bakers toyed with quantities of different ingredients until the software predicted a split chance of cake and cookie, which they called cakie. More tinkering led to another hybrid that is equal parts bread and cookie – the breakie.

Despite being a smart cookie, the algorithm could not cook up baking directions, a task that fell on the shoulder of Robinson. She also took the liberty to add other flavorings and spices like vanilla extract, cinnamon and chocolate chips and split the recommended quantity of sugar between white and brown.

Like any true scientists, they corroborated the findings of their theoretical model by heading to the kitchen and putting the recipes to the test.

So how do the creations taste like? "Like a cookie, but more airy," Robinson said of the breakie in a YouTube video. Meanwhile, the cakie is crispy and cackey – "It is yummy," she assured.

Search Trends