Skip to main content

MIT's Pic2Recipe A.I. Can Predict Food Ingredients By Analyzing a Photo

Pic2Recipe: Predicting recipes from photos
Scrolling through food photography can bring on the desire to recreate a dish at home, but what if the ingredients aren’t listed? Could there be a way to find out just by analyzing the image? That’s what researchers at the Massachusetts Institute of Technology asked when they set out to create a deep learning algorithm that could predict a recipe based just on a photo. The research, published on July 20, resulted in a program called Pic2Recipe that could accurately predict a dish’s recipe based on a photo, with a 65 percent success rate.

Earlier attempts to turn photos into recipes were limited by smaller datasets — although “small” is relative to all the possible recipes available. One study used 65,000 recipes, but it only included traditional Chinese cuisine; another only had about a 50 percent accuracy in initial testing. Because deep learning algorithms “learn” from being fed large quantities of data, these resulting programs were missing large gaps in potential ingredients, affecting the program’s accuracy.

To create a larger database, the researchers from MIT’s Computer Science and Artificial Intelligence Laboratory (CSAIL) knew the software would have to be based on a wide-ranging set of data. So to solve that narrow dataset, the team turned to large sets of photos and recipes that already exists — food websites. Compiling data from places like Food.com and All Recipes, the team created Recipe1M, a dataset of over one million recipes.

Using those recipes and the associated images, the team was able to train the software to use object recognition to pick up on what each dish’s ingredients might be. With a list of ingredients, the system then selected  the recipe that best matched the list. Pic2Recipe was able to recognize ingredients like flour, eggs, and butter.

The program doesn’t actually identify a recipe from the photo — it creates a list of ingredients. With that list, the program can then go through that one-million-recipe database and choose the one with ingredients that match the list from the photo.

“In computer vision, food is mostly neglected because we don’t have the large-scale datasets needed to make predictions,” said Yusuf Aytar, a postdoctoral associate who co-wrote the paper with MIT professor Antonio Torralba. “But seemingly useless photos on social media can actually provide valuable insight into healthy habits and dietary preferences.”

Since the computer already has that large dataset, it is also able to able to pick up on a number of different patterns, like that the average recipe has nine ingredients and the most popular are salt, butter, sugar, olive oil, water, eggs, garlic cloves, milk, flour, and onion.

The software could have a number of different real-world uses. A person could snap a photo at a restaurant to learn how to make the dish at home, or to track her personal nutrition.

The program, while it contains a wider dataset than earlier attempts, still has a few gaps. The researchers said the program has trouble with dishes that are a bit more ambiguous, like smoothies and sushi rolls. Similar recipes with a number of different variations, like lasagna for example, also tended to confuse the program.

The group plans to continue developing the program and even hopes to give the system the ability to tell how something is cooked, like picking up the difference between stewed and diced. Future work could also expand the program’s ability to recognize specific ingredients, like determining the type of onion instead of just listing onion.

You don’t have to wait until Pic2Recipe becomes a full fledged app to try it out. An online version allows users to upload images and try it out.

Hillary K. Grigonis
Hillary never planned on becoming a photographer—and then she was handed a camera at her first writing job and she's been…
Prime Day drone deals: budget drones as cheap as $27
Best Prime Day Deals

Prime Day deals are bringing discounts on almost every kind of tech into play, and while there are a lot of GoPro Prime Day deals worth taking a look at, sometimes you just need to take to the skies. If you're a photographer looking to do so, or if you simply want something to fly around for fun, we've tracked down some impressive Prime Day drone deals. While drones are often thought of as being too expensive for a hobbyist to consider, prices are starting incredibly low with these Prime Day drone deals. So suit up and read onward if saving big on a drone sounds good to you this Prime Day. And be sure to grab a deal while you can if you see something you like, as inventory is likely dwindling and these Prime Day drone deals can end without notice.

Best Prime Day drone deals

Read more
Stargazers, this Celestron smart telescope is $48 off for Prime Day
The Celestron StarSense Explorer LT 80AZ telescope on a white background.

Look at the stars in the night sky with the Celestron StarSense Explorer LT 80AZ telescope, which is still available from this year's Prime Day telescope deals for a cheaper-than-usual price of $182. The $48 discount on its original price of $230 is found on Amazon, but we're no sure how much time you've got left to take advantage of this offer. It's not a good idea to wait until the last minute of the shopping event as stocks may be gone by then, so if you want this telescope, you're going to have to proceed with the transaction immediately.

Why you should buy the Celestron StarSense Explorer LT 80AZ telescope
The Celestron StarSense Explorer LT 80AZ telescope is our pick for the best all-around telescope in our roundup of the best telescopes for beginners, partly because of the benefits that you'll gain from the Starsense Explorer app. Once you launch the app, it will generate a list of celestial objects that you can view through the telescope depending on your exact location and the time. You'll be able to observe stars, planets, and even galaxies through the Celestron StarSense Explorer LT 80AZ telescope with the help of this app.

Read more
Best Prime Day camera deals: Canon, Sony, Nikon
Nikon Z5 Review

Camera bodies and camera lenses can get quite expensive, especially if you're trying to experiment with new styles or techniques. Prime Day was the perfect opportunity to grab yourself something new, but even though Prime Day is over, there are still quite a few great Prime Day deals on cameras and lenses that you can take advantage of. We've collected a few of our favorites from the big companies below, but you may also want to check out the remaining Prime Day smartphone deals for some higher-end smartphones that can also act as a camera.

Best Prime Day Canon camera deals

Read more