The more meat and animal products we eat, the quicker we deplete the Earth's resources. Could artificial intelligence devise new ways to make meat-free foods that taste great as well?

Remember the last burger you really enjoyed – try to summon up its rich, juicy taste in your mind and its chewy, firm-yet-soft-yet-crunchy texture. Try to recall how the taste filled your mouth with flavour as you bit into it. Remember the smell. Remember how satisfying it was.

Now think about how it might have tasted without any meat in it. Farming the meat for beef burgers takes a hefty toll on the environment around the world. But would you have been happy with the spongy substitute some vegetarians enjoy? What if there was another way of recreating the sensory extravaganza of a burger?

A group of entrepreneurs are now turning to artificial intelligence to find the answer. They want to produce something so similar in taste and texture to a real beef burger that it would be impossible to tell if animals were involved in its production.

Meat is not their only target: mayonnaise, cookie dough, cheese, chocolate, and pretty much every other food produced using animal-based ingredients are in their sights. Their dream is to make the world’s diet vegan by default, to make a plant-based option the easiest, cheapest and most convenient one on the menu.

Of course, the idea of replacing animal-based food is not new. But AI is offering a more powerful and promising way of doing this. It is allowing food scientists to explore new ingredients, to develop surprising recipes, and to find innovative ways of replicating all the tasty fats and proteins that eggs, milk, and meat bring to our food.

Crazy food

“The way we eat today is, mostly, crazy,” says Josh Tetrick, the founder and CEO of food start-up Hampton Creek, who are among those using AI to develop new foods. “Six billion people are just eating really bad food.”

Despite being a strict vegan who would prefer a kale salad rather than a muffin, Tetrick is convinced that today a “healthy and sustainable food only works for a tiny slice of the population”. He imagines a future where choosing to be vegetarian or vegan is not something only open to the better off in society. He wants to reach those who don’t get to choose.

His quest started in a very unsophisticated fashion – he just scouted for plant-based food, adding them to a basic database. “I had no idea of what machine learning was,” he says. “I had no idea of what computational biology was.”

Powerful machine learning algorithms allow him to systematically find new ingredients or formulations that can provide substitutes for animal-based products

Then he was introduced to AI by a friend. The powerful machine learning algorithms allow him to systematically find new ingredients or formulations that can provide substitutes for animal-based products.

He is not alone in his mission.Thousands of miles south, in Santiago, Chile, Matias Muchnick, Karim Pichara and Pablo Zamora are trying something similar with their new company NotCo. They want people to eat in a more nutritious and less environmentally taxing way.

“If we had to deliberately come out with the worst possible way to feed ourselves, it would be the way we do it today,” says Muchnick.

Animal-based food takes a hefty toll on our planet’s resources. As outlined in this BBC Future article, eliminating meat from the human diet would cut up to 60% of the food-related greenhouse emissions, and free up the disproportionate share of fresh water and agricultural land that livestock use. There also are the many ethical, labour, land and garbage disposal issues around big meat processing plants.

“The human costs are tremendous, these companies essentially starve the people who grow the meat for them,” says the journalist Katy Keiffer, author of the book What’s the Matter with Meat.

The first step to finding replacements is identifying as many candidates as possible

Still, meat demand in the world is increasing as populations and economies grow. Global production of meat has doubled from 159 million tonnes in 1986 to almost 318 million in 2014, according to the UN’s Food and Agriculture Organisation (FAO) . Even in countries where it is not a luxury, meat consumption stubbornly refuses to fall. Both in the US and in the UK, it is estimated that the proportion of the population who are vegetarians – let alone vegans – is in the single digits.

As Keiffer says, “it's going to be hard to tell people who did not have the advantage of eating meat and are just beginning to discover it, that they can't have it”. So, whatever replacements for meat that Tetrick and Muchnick come up need to taste and feel like the original product. But they also have to be scaleable, accessible, and hopefully, healthier. So how is AI helping them to do this?

Building blocks

For people like Tetrick and Muchnick, the way to start is a change in perspective. Their idea of a muffin is very different from how the average person sees one. They see a toolbox where we see a pantry; they see a chemical experiment where we see a treat. “The muffin needs to aerate, it needs to bun, it needs to brown. It needs a texture, it needs to have a shelf life”, explains Tetrick. (He offers no word on how tasty it needs to be, however.)

Their aim is to find a way to make the muffin do all this, but using different ingredients. It is a “very difficult puzzle” to solve, says Ricardo San Martin, visiting professor at the Alternative Meat Lab of the University of California in Berkeley. On the one hand, every single aspect of the experience, from the taste and texture to the way the food changes when it is heated, is the product of specific molecules or a micro-component, like proteins or fats. In our current diet, many of these come from animal ingredients.

The first step to finding replacements is identifying as many candidates as possible. This is done by scouting the world in search of edible plants. The thing is, no one knows exactly which ones would work. Even the people who eat them every day might have no inkling they could be used to replace pork, or eggs.

Then the food has to be analysed. Researchers have to figure out what each plant-based ingredient is made of, right down to the molecular level, as well as the proportions of each one of their components. All this data goes to a database of thousands, or even millions of entries, depending on how detailed the analysis is. There are more than 250,000 edible plant species in the world, according to the FAO, and uncountable varieties of each one of them.

As if the puzzle weren’t hard enough, there is also the issue of how these different components interact with each other. Get it wrong and certain combinations can produce unexpected and unpleasant tastes or undesired reactions. The problem, as San Martin points out, is that “the interactions between the compounds are very complex,” which means that many things can go wrong in unforeseeable ways.

While the AI doesn’t get it right at the first time, it improves with every mistake, often helped by human feedback

Unravelling so many variables is a mind-boggling process. But this is exactly where AI can be useful. Instead of manually tasting and expecting to hit a jackpot by sheer chance, AI uses are more logical approach. It does so through machine learning, a technique that basically allows a computer to learn how to solve a problem by trying and failing at it many times. It is used for solving many different problems, from identifying your face in a picture to helping doctors spot cancer.

While the AI doesn’t get it right at the first time, it improves with every mistake, often helped by human feedback.

The results can be surprising. Hampton Creek recently found the isolated protein of an Indian legume called mung bean has similar properties to scrambled eggs. One of NotCo’s most dazzling formulations is its chocolate prototype: a bizarre combination of broccoli, goji berries, champignon mushrooms and a nut, whose name, sadly, they won’t share with us.

So far, these companies have used AI-led approach to create emulsions: liquid foods like mayonnaise, scrambled egg replacements, or cookie dough. Solid foods are more complicated to mimic. These requires “the slow release of molecules, of crunchiness” that, as San Martin says, are part of the experience of biting and eating. It is like solving a 3D puzzle instead of just a 2D one. NotCo has a plan, though.

“We are creating a milk that is just like cow milk,” says Zamora. “Not only with a similar, or better nutritional profile than cow milk, but also with its same functional structure.” By this he means it can be used in the same way cow’s milk currently is – for drinking, cooking or as a base for making cheese, yoghurt or ice cream. Except it would be a vegan product.

However, the big target is replacing meat, and both start-ups are applying different approaches to this muscular problem. Hampton Creek is cultivating muscle and fat cells in the laboratory, and is working on how to feed those cells with plant-based nutrients. NotCo is looking at ways to recreate meat with only plant-based ingredients.

NotCo’s AI is named after Giuseppe Arcimboldo, a Renaissance painter who shaped portraits with fruit and vegetables

This subtlety is illuminated by the name of NotCo’s AI robot: Giuseppe. It is named after Giuseppe Arcimboldo, a Renaissance painter who shaped human portraits with fruits and vegetables. “The animal ingredient is never an option for us,” says Muchnick.

But even with AI, their progress is a painstakingly slow. The puzzle is almost impossibly delicate, and any small thing out of place can ruin it. It is a bit like building a house or a cathedral, explains San Martin. They are both made from the same basic building blocks, but one of them is far grander than the other. For those trying to change the way we eat, anything less than a cathedral will not do.

Future challenges

Creating these new foods, however, is only the first challenge. Convincing the world to eat them is another.

“We change our diets extremely slowly,” says David Hughes, emeritus professor of food marketing at Imperial College London. Food consumption patterns are stubborn, even when there are good alternatives. Marketing is vital, but it is expensive. The $220m (£164m) Hampton Creek has received in investment, and the $2.6m (£1.9m) backing NotCo, are a far cry from the budgets wielded by the international food giants. Nestlé, the world’s biggest food company, is valued at $229.5bn (£170bn).

Hughes believes there will be space for all these players in the future. The combination of health, environmental and animal welfare concerns “will drive more acceptance of these artificial intelligence products”. He believes they could become a significant, but still a minority, part of the protein market worldwide.

If these new foods are formulated to cater only for the tastes of the white Westerners operating the AI, they may be doomed to fail

But there is another problem that might prevent them getting the global reach they desire.

As it turns out, algorithms have their own quirks. “They are biased in terms of how do you feed them, how you interpret the data, and how you extract the data”, explains San Martin.

The problem is, food preferences rely heavily on cultural preferences: try getting Americans to like Marmite, for example. If these new foods are formulated to cater only for the tastes of the white Westerners operating the AI alchemists creating them, they may be doomed to fail. Tetrick insists he is trying to tackle this problem by hiring a team whose members come from many different parts of the world.

While none of these companies have yet had issues with national health authorities over the safety of their products, this could too could create problems if they ever resort to any ingredient that hasn’t been used before as food.

But perhaps the knottiest problem of all will be something machines will probably never be able to solve. Whatever strange combinations these AIs find to replace meat, cheese, or eggs, they are likely to come up with a concoction that no one has eaten before. And humans are fickle creatures – old habits die hard.

Jose Luis Penarredonda is a writer for BBC Future, he tweets at @noalsilencio. 

Join 800,000+ Future fans by liking us on Facebook, or follow us on Twitter.

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Earth, Culture, Capital, and Travel, delivered to your inbox every Friday.