Cooking is an art and, in many cases, a time honored tradition passed down between generations. Food is a major part of who we are, it can be defined by where we live. It is connected to people's culture and has a personal sense of identity. The warm memories of family get togethers and mom's home cooking have deep connections and are centered around one major theme, food. It's not just about the final product but the process of cooking with family and friends. Passing recipes between loved ones or the secret family recipe is a valued concept by so many people. As with just about everything, the internet has massively changed how people find new recipes. There are a ton of websites dedicated to sharing recipes such as allrecipes.com, delish.com, taste.com, of the Food Network website. People can share recipes and find new family dishes that become regular meals but, those recipes are not always made by people. With machine learning growing more and more functional, an increasing number of recipes on the internet are actually computer generated.
Deep learning is being applied in entirely new ways and one of those is to create recipes by scraping information from existing webpages. The data is passed through complex analysis and clustering techniques that ultimately results in recipes being generated based on popular dishes and food pairings. At face value, it sounds incredibly impressive and a little deceitful. When looking for a new recipe online, there is an assumption that the recipe you pick was shared by somebody who had made the dish but, that is no longer the case. It's very possible that you have already made a dish using a recipe that was created by an algorithm. The technology is certainly not perfect and there have been some pretty notable blunders; one computer generated recipe called for "1 cup of boiled frosting" and "1 sour and large fish". There are plenty of other examples and quick google search will show a number of the mishaps but the technique is getting better and, at times, indiscernible from a family recipe.
HOW IT'S DONE
We will take a look at a project created by Derek Jia (2019) that provides a step-by-step walkthrough of creating AI generated recipes. His Github posting includes a well written guide along with coding files. Tools used were Python and some of it's ML libraries such as sklearn and scipy. The technique to create a machine learn model follows the standard process.
Source a dataset for testing/training
Preprocess the data and clean it up
Exploratory analysis and clustering
Final output
Source the Data and Preprocessing
Data sourcing is key to creating an accurate model. This is typically done using scrapping or webcrawling. You can use some of the more popular websites like Allrecipe's, Allrecipe's has specific rules for webcrawling. The data then needs to be standardized and ran thorough Natural Language Processing (NLP) to pull specific information such as instructions, cook times, temperatures, etc.
Analysis and Clustering
This is the part where you can begin to really look at the data. It's best to experiment with different classification algorithms to find the most accurate. The recipes can be classified into cuisine type using a ML algorithm. On this specific project the programmer used the sklearn library and constructed different models listed; Linear SVC model, Naive Bayes, Random Forest, and Logistic Regression. The Random Forest model returned the most accurate. The data can then be looked at for correlations; what types of cuisines use the most similar ingredients? What about most different? What are popular ingredient pairings? Then the recipes can be clustered using K-means or T-SNE and finally put to a generative adversarial network (GAN) which is a type of neural network.
The Github project is an open-source project: AI Generated Recipes.
Brewing Beer with Artificial Intelligence
IntelligentX is a beer brewing company that is using artificial intelligence recipes combined with the expertise of a Brewmaster. They have found a balance between a qualitative and quantitative approach.
IntelligentX built a machine learning algorithm to analyze top selling beer to develop a computer generated recipe. (Marr, 2019) But instead of blindly accepting the recipe as it is, they handed it off to their Brewmaster who made the call on what ingredients to use. This is a great example of using data to make better informed decisions versus wholesale adoption. IntellgientX didn't stop there, they went forward with implementing a model truer to artificial intelligence and developed a method to capture ongoing information that can be used to improve their model.
"IntelligentX creates four different varieties of beer—Black AI, Golden AI, Pale AI, and Amber AI. They ask customers to follow the URL link provided on the bottles to give their feedback through the Facebook Messenger app about the beer they try. By answering a series of 10 questions, the 80 percent of customers who have followed the link have given the company more than 100,000 data points." (Marr,2019)
By combining artificial intelligence and real world expertise, IntelligentX is showing what it means to adopt innovative technology into business. And while there is always room to improve one thing is for sure, the adoption of artificial intelligence and all of it's sub technologies will only become more common place as computing power and datasets grow.
REFERENCES:
Davidsson, M. Using machine learning to generate recipes that actually work, https://towardsdatascience.com/using-machine-learning-to-generate-recipes-that-actually-works-b2331c85ab72
Jia, D. (2019), AI Generated Recipes, https://github.com/derekdjia/AI_Generated_Recipes/blob/master/README.md
Limer, E. (2016), Computer Generated Recipes Are Hilarioulsy Horrifying, https://www.popularmechanics.com/technology/apps/a19304/computer-generated-recipes-are-gut-bustlingly-bad/
Marr, B. (2019), How Artificial Intelligence is Used to Make Beer, https://www.forbes.com/sites/bernardmarr/2019/02/01/how-artificial-intelligence-is-used-to-make-beer/?sh=39e652f70cf4
Comentários