PHOTO: Photo Illustration: Shutterstock / CNN
Now playing
01:11
How AI is changing the way we work
PHOTO: @Virgin_Orbit
Now playing
01:03
Watch this rocket launch from the wing of a jumbo jet
WASHINGTON, DC - JUNE 22: Facebook
WASHINGTON, DC - JUNE 22: Facebook's Chief Operating Officer Sheryl Sandberg speaks with AEI president Arthur C. Brooks during a public conversation on Facebook's work on 'breakthrough innovations that seek to open up the world' at The American Enterprise Institute for Public Policy Research on June 22, 2016 in Washington, DC. (Photo by Allison Shelley/Getty Images)
PHOTO: Allison Shelley/Getty Images North America/Getty Images
Now playing
01:23
Hear Sandberg downplay Facebook's role in the Capitol riots
Passengers look out at American Airlines flight 718, a Boeing 737 Max, parked at its gate at Miami International Airport as people load for the flight to New York on December 29, 2020 in Miami, Florida. The Boeing 737 Max flew its first commercial flight since the aircraft was allowed to return to service nearly two years after being grounded worldwide following a pair of separate crashes. (Photo by Joe Raedle/Getty Images)
Passengers look out at American Airlines flight 718, a Boeing 737 Max, parked at its gate at Miami International Airport as people load for the flight to New York on December 29, 2020 in Miami, Florida. The Boeing 737 Max flew its first commercial flight since the aircraft was allowed to return to service nearly two years after being grounded worldwide following a pair of separate crashes. (Photo by Joe Raedle/Getty Images)
PHOTO: Joe Raedle/Getty Images
Now playing
03:15
Airlines & TSA boost security ahead of Inauguration
Philanthropist Chief Executive Officer of Las Vegas Sands Sheldon Adelson listens to US President Donald Trump address to the Israeli American Council National Summit 2019 at the Diplomat Beach Resort in Hollywood, Florida on December 7, 2019. (Photo by MANDEL NGAN / AFP) (Photo by MANDEL NGAN/AFP via Getty Images)
Philanthropist Chief Executive Officer of Las Vegas Sands Sheldon Adelson listens to US President Donald Trump address to the Israeli American Council National Summit 2019 at the Diplomat Beach Resort in Hollywood, Florida on December 7, 2019. (Photo by MANDEL NGAN / AFP) (Photo by MANDEL NGAN/AFP via Getty Images)
PHOTO: Mandel Ngan/AFP/Getty Images
Now playing
03:14
Major GOP donor and casino magnate Sheldon Adelson dies
Democratic presidential candidate and former US Vice President Joe Biden speaks on the state of the US economy on September 4, 2020, in Wilmington, Delaware. (Photo by JIM WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
Democratic presidential candidate and former US Vice President Joe Biden speaks on the state of the US economy on September 4, 2020, in Wilmington, Delaware. (Photo by JIM WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
PHOTO: JIM WATSON/AFP/Getty Images
Now playing
02:02
Why Wall Street is hopeful about Biden despite economic challenges
Now playing
05:39
Ben & Jerry's calls for Trump's removal
This illustration picture shows the social media website from Parler displayed on a computer screen in Arlington, Virginia on July 2, 2020. - Amid rising turmoil in social media, recently formed social network Parler is gaining with prominent political conservatives who claim their voices are being silenced by Silicon Valley giants. Parler, founded in Nevada in 2018, bills itself as an alternative to "ideological suppression" at other social networks. (Photo by Olivier Douliery/AFP/Getty Images)
This illustration picture shows the social media website from Parler displayed on a computer screen in Arlington, Virginia on July 2, 2020. - Amid rising turmoil in social media, recently formed social network Parler is gaining with prominent political conservatives who claim their voices are being silenced by Silicon Valley giants. Parler, founded in Nevada in 2018, bills itself as an alternative to "ideological suppression" at other social networks. (Photo by Olivier Douliery/AFP/Getty Images)
PHOTO: Olivier Douliery/AFP/Getty Images
Now playing
03:49
Parler sues Amazon in response to being deplatformed
Panasonic
Panasonic's Augmented Reality Heads-up Display
PHOTO: Panasonic USA
Now playing
01:06
This tech gives drivers directions on the road in front of them
PHOTO: Wimkin
Now playing
03:18
The online warning signs of the violent Capitol siege
PHOTO: Twitter
Now playing
02:39
Twitter permanently suspends Donald Trump from platform
PHOTO: CNN
Now playing
03:56
'What are we supposed to do?': Rioter speaks to CNN reporter
President Donald Trump arrives to speak at a rally protesting the electoral college certification of Joe Biden as President, Wednesday, Jan. 6, 2021, in Washington. (AP Photo/Evan Vucci)
President Donald Trump arrives to speak at a rally protesting the electoral college certification of Joe Biden as President, Wednesday, Jan. 6, 2021, in Washington. (AP Photo/Evan Vucci)
PHOTO: Evan Vucci/AP
Now playing
01:38
Facebook blocks Trump through end of presidency
PHOTO: CNN
Now playing
02:56
CNN speaks to Trump supporters about Trump's election lies
NEW YORK, NY - JUNE 3: The Google logo adorns the outside of their NYC office Google Building 8510 at 85 10th Ave on June 3, 2019 in New York City. Shares of Google parent company Alphabet were down over six percent on Monday, following news reports that the U.S. Department of Justice is preparing to launch an anti-trust investigation aimed at Google. (Photo by Drew Angerer/Getty Images)
NEW YORK, NY - JUNE 3: The Google logo adorns the outside of their NYC office Google Building 8510 at 85 10th Ave on June 3, 2019 in New York City. Shares of Google parent company Alphabet were down over six percent on Monday, following news reports that the U.S. Department of Justice is preparing to launch an anti-trust investigation aimed at Google. (Photo by Drew Angerer/Getty Images)
PHOTO: Drew Angerer/Getty Images North America/Getty Images
Now playing
03:25
Google employee on unionizing: Google can't fire us all
FILE - In this undated file photo issued by the University of Oxford, a researcher in a laboratory at the Jenner Institute in Oxford, England, works on the coronavirus vaccine developed by AstraZeneca and Oxford University. Britain on Wednesday, Dec. 30, authorized use of a second COVID-19 vaccine, becoming the first country to greenlight an easy-to-handle shot that its developers hope will become the "vaccine for the world." The Department of Health said it had accepted a recommendation from the Medicines and Healthcare Products Regulatory Agency to authorize the vaccine developed by Oxford University and U.K.-based drugmaker AstraZeneca.  (John Cairns/University of Oxford via AP, File)
FILE - In this undated file photo issued by the University of Oxford, a researcher in a laboratory at the Jenner Institute in Oxford, England, works on the coronavirus vaccine developed by AstraZeneca and Oxford University. Britain on Wednesday, Dec. 30, authorized use of a second COVID-19 vaccine, becoming the first country to greenlight an easy-to-handle shot that its developers hope will become the "vaccine for the world." The Department of Health said it had accepted a recommendation from the Medicines and Healthcare Products Regulatory Agency to authorize the vaccine developed by Oxford University and U.K.-based drugmaker AstraZeneca. (John Cairns/University of Oxford via AP, File)
PHOTO: John Cairns/University of Oxford/AP
Now playing
02:36
AstraZeneca vaccine provides 'logistical convenience'
(CNN Business) —  

Even a toddler can figure out the right way to put together a pizza: you roll out the dough, add some sauce, sprinkle on cheese, put the toppings on, then pop the whole thing in the oven.

It’s a much trickier task for a computer to grasp, however. How does it know what to do first? Whether cheese should go on before or after sauce? Is there a right way to arrange toppings? And what about that whole baking thing?

Researchers at MIT and the Qatar Computing Research Institute set out to answer these questions with a recent project in which they taught artificial intelligence to, well, not exactly make a pizza but, more precisely, figure out the order in which it should be constructed. Essentially, the researchers built an AI system that can look at a photo of pizza and deduce what ingredients should go on which layer of the pie. The researchers presented a paper on their work last week at an AI conference in Long Beach, California.

PHOTO: Shutterstock

It might sound silly, but there’s a bigger point than creating AI that knows whether pepperoni should be placed on top of cheese.

Computers can already learn how to identify specific objects in images, but when some of those objects are partially hidden (say, arugula laid atop prosciutto), it gets harder for them to figure out what they’re looking at. And with food, which often has many different layers (think a lattice-topped pie or a salad), it can be particularly tricky for a computer to figure out what should go where. To see a picture and say it’s a pizza is easy. To be able to break it down into its various parts and reassemble it is a bit closer to understanding.

Dimitrios Papadopoulos, a postdoctoral researcher at MIT who led the project, told CNN Business that if a computer can determine the essential ingredients and how they should be layered on a pizza, for instance, it may be more easily able to figure out the various parts of other kinds of food images, too.

“Food is a big aspect of our lives, and also cooking, so we wanted to have a model that could understand food in general,” Papadopoulos said.

Why start with pizza, though? Papadopoulos said that he and his fellow researchers knew they wanted to work on an AI project related to food. And when they started thinking about building AI that could mirror a recipe’s procedure and deconstruct an image into layers, pizza immediately sprang to mind.

Also, it’s incredibly easy to find photos of pizza online, and they tend to be pretty uniform: many of them consist of a picture of a round pie, shot from the top, with dough, sauce, and toppings.

The researchers collected thousands of pizza photos from Instagram, then had workers from Amazon’s Mechanical Turk service label ingredients such as tomatoes, olives, basil, cheese, pepperoni, peppers, and a few types of sauce. After that, they used these labeled photos to train a bunch of ingredient-specific generative adversarial networks, or GANs, which consist of two neural networks competing with each other to come up with something new based on the data set. In this case, each of these GANs can look at a photo of a pizza and generate a new image of the pizza that either adds an ingredient that wasn’t on it previously or subtracts one that was already on the pie.

For instance, there is a GAN for adding or subtracting pepperoni: show it a picture of a pepperoni pizza, and it should be able to generate a new pizza that is identical but has no pepperoni on it, and vice versa, as the researchers illustrate here. Others can do things such as add or subtract arugula or make the pizza appear baked or unbaked.

Papadopoulos believes this research could lead to non-food applications as well, such as a digital shopping assistant that uses AI to figure out how to put together a fashionable outfit.

“It’s exactly the same idea: you don’t try to add pepperoni; you try to add a jacket,” he said.