Mastering the art of machine learning cooking
Machine learning is the future. If, of course, we can teach computers to understand the signal from the noise. Neural networks are learning to do amazing things from recognizing images to driving and even coming up with recipes. But maybe we should hold off on hiring robots to replace our chefs.
Machine learning is the hottest thing going on in tech these days. It’s the dream – instead of painstakingly writing code one piece at a time, the machine would be able to do it for themselves with a deep neural network. It’s the first step to a truly awesome future of robotics. (Or possibly not.) We probably shouldn’t let them start with dinner though.
Neural networks are computer learning algorithms modelled on the human brain and nervous system. Basically, the ideas is to make an artificial brain that can solve problems the same way a human could. The practical implications are limitless. However, it’s taking some time to get the artificial neurons up to speed in the same way a brain could. After all, most six-year-olds can reliably recognize handwritten numbers and letters. Just try the same with your phone and see how well that goes.
Research scientist Janelle Shane has been experimenting with neural networks thanks to the open source torch add-on framework for character based neural networks (char-rnn) by Andrej Karpathy. Using a bunch of recipes, she’s been exploring how the neural network has learned to create recipes, among other things. (There’s also a list of computer generated Pokemon that are hysterical.)
The results… aren’t good.
Not quite Julia Child
The neural network started absolutely from scratch, which lead to fairly incomprehensible results in the beginning. Janelle Shane documents the evolution of these recipes over at her blog, Postcards from the Frontiers of Science. First, it had to figure out capital letters and lowercase letters, before moving on to appropriate amounts of ingredients and the proper syntax of a recipe.
Here’s a recipe from relatively early in the network’s learning process:
Immediately Cares, Heavy Mim
3 dill loasted substetcant
1 cubed chopped whipped cream
3 unpreased, stock; prepared; in season
3 cup milk
1 ½ cup mOyzanel chopped
½ teaspoon lemon juice
1 ¼ teaspoon chili powder
2 tablespoon dijon stem – minced
30 dates afrester beater remaining
Bake until juice. Brush from the potato sauce: Lightly butter into the viscin. Cook combine water. Source: 0 25 seconds; transfer a madiun in orenge cinnamon with electres if the based, make drained off tala whili; or chicken to well. Sprinkle over skin greased with a boiling bowl. Toast the bread spritkries.
Yield: 6 servings
You might notice some problems with this recipe. I’m not entirely sure where I could buy “mOyzanel” or how to both cube and chop whipped cream. Additionally, the instructions suggest you should bake first and then mix “ingredients”, which is probably not how they do it at Le Cordon Bleu.
But the neural network does keep learning. Here’s a recipe that it came up with relatively later:
Pears Or To Garnestmeam
¼ lb bones or fresh bread; optional
½ cup flour
1 teaspoon vinegar
¼ teaspoon lime juice
Brown salmon in oil. Add creamed meat and another deep mixture. Discard filets. Discard head and turn into a nonstick spice. Pour 4 eggs onto clean a thin fat to sink halves.
Brush each with roast and refrigerate. Lay tart in deep baking dish in chipec sweet body; cut oof with crosswise and onions. Remove peas and place in a 4-dgg serving. Cover lightly with plastic wrap. Chill in refrigerator until casseroles are tender and ridges done. Serve immediately in sugar may be added 2 handles overginger or with boiling water until very cracker pudding is hot.
Yield: 4 servings
I mean, it’s still not edible. But the network has managed to figure out the correct order for how to handle ingredients and that food has to be served! So that’s good.
According to Shane, “This is particularly impressive given that it has the memory of a goldfish – it can only analyze 65 characters at a time, so by the time it begins the instructions, the recipe title has already passed out of its memory, and it has to guess what it’s making.”
To serve man
Of course, the neural network is still figuring out what people like to eat. Shane notes that the generated recipe titles “can get a little odd”, thanks to a creativity variable that she can control. Whether the neural network is being conservative or creative, the results are pretty adventurous.
Low creative options include such delicious treats as:
- Cream Cheese Soup
- Cream Of Sour Cream Cheese Soup
- Chocolate Cake (Chocolate Cake)
- Chocolate Chocolate Chocolate Cake
- Chocolate Chicken Chicken Cake
- Chocolate Chocolate Chocolate Chocolate Cake
- Chocolate Chips
- Chocolate Chips With Chocolate Chips
To be fair, most of my favorite recipes include chocolate. I can’t exactly fault the neural network for it’s excellent taste.
Things get even weirder when she ups the creativity variable.
- Beef Soup With Swamp Peef And Cheese
- Chocolate Chops & Chocolate Chips
- Crimm Grunk Garlic Cleas
- Beasy Mist
- Export Bean Spoons In Pie-
Shell, Top If Spoon and Whip The Mustard
- Chocolate Pickle Sauce
- Whole Chicken Cookies
- Salmon Beef Style Chicken Bottom
- Star *
- Cover Meats
- Out Of Meat
- Completely Meat Circle
- Completely Meat Chocolate Pie
- Cabbage Pot Cookies
- Artichoke Gelatin Dogs
- Crockpot Cold Water
Personally, I’m definitely up for a completely meat chocolate pie. You? Of course, the internet being the amazing place that it is, someone has already illustrated these recipes. They look so… appetizing.
Machine Learning for fun and profit
Recipes are just one facet of the vast effort to get machines to learn better. AI, machine learning, and the future of robotics are some of the hottest skills to have in Silicon Valley these days. According to Wired, “the cost of acquiring a top AI researcher is comparable to the cost of acquiring an NFL quarterback”.
Microsoft, Apple, Oracle., Facebook, GE, Twitter, Uber and other heavyweights have been snapping up start-ups and developers with machine learning focuses. It’s not about the coding, it’s about figuring out results from vast amounts of data.
What should a young developer itching to get into the machine learning field do? Coursera and Udacity offer online courses, and there are a number of universities that are slowly getting into the field. Honestly, the best way to learn is to try for yourself with the open-source options that are available today.
So, go forth and experiment! But maybe stick with Mastering the Art of French Cooking instead of Chef Watson’s recipes.