Humanity’s got itself a problem. As Homo sapiens balloons as a species—to perhaps nearly 10 billion by 2050—the planet stubbornly stays the same size, meaning the same amount of land must support way, way more people. Add the volatility of global warming and consequent water shortages, and the human race is going to have some serious trouble feeding itself.

Perhaps it’s serendipitous, then, that the machines have finally arrived. Truly smart, truly impressive robots and machine learning algorithms that may help usher in a new Green Revolution to keep humans fed on an increasingly mercurial planet. Think satellites that automatically detect drought patterns, tractors that eyeball plants and kill the sick ones, and an AI-powered smartphone app that can tell a farmer what disease has crippled their crop.

Forget scarecrows. The future of agriculture is in the hands of the machines.

A Digital Green Thumb

Deep learning is a powerful method of computing in which programmers don’t explicitly tell a computer what to do, but instead train it to recognize certain patterns. You could feed a computer photos of diseased and healthy plant leaves, labeled as such. From these it will learn what diseased and healthy leaves look like, and determine the health of new leaves on its own.

That’s exactly what biologist David Hughes and epidemiologist Marcel Salathé did with 14 crops infected by 26 diseases. They fed a computer more than 50,000 images, and by learning on its own, the program can correctly identify 99.35 percent of the new images they throw at it.

Still, those are manipulated images, with uniform lighting and backgrounds so it’s easier for the computer to make sense of the leaves. Pluck an image of a diseased plant from the Internet and feed it to the computer and the accuracy is around 30 to 40 percent.

Not terrible, but Hughes and Salathé hope to see this AI power their app, PlantVillage, which currently allows farmers around the world to upload a photo of their ailing plants to a forum for experts to diagnose. To smarten up the AI, they'll continue feeding it photos of diseased plants. “More and more images from various sources, in terms of how the pictures were taken, time of year, location, and so on,” says Salathé. “And the algorithm can just pick up on that and learn.”

This isn’t simply a matter of ferreting out infections: Plenty of other things beat plants up. “Most diseases that hamper growers are physiological stresses, so not enough calcium or magnesium or too much salt or too much heat,” says Hughes. “People often think it's a bacterial or fungal disease.” Misdiagnoses can lead to farmers wasting money and time on pesticides or herbicides. In the future, AI could help farmers quickly and accurately pinpoint the problem.

After that, the humans will wrest back control—because while an app might be able to find the problem, only an extension expert can tailor a solution to a specific climate or soil or time of year. The UN’s Food and Agriculture Organization considers such technology a “useful tool” for crop management, but the expert’s word is doctrine. Thus, says Fazil Dusunceli, a plant pathologist with the FAO, such electronic results are welcome, but “final pest management decisions should be taken in collaboration with experts on the ground.”

Tractor Trainer

While the developing world is hungry for agricultural knowledge, the developed world is drowning in pesticides and herbicides. In the US each year, farmers use 310 million pounds of herbicide—on just corn, soy, and cotton fields. It’s the spray-and-pray approach, not so much sniping as carpet bombing.

A company called Blue River Technology may have hit upon solution, at least as far as lettuce is concerned. Its LettuceBot looks like your typical tractor, but in fact it’s a machine-learning-powered … machine.

Blue River claims the LettuceBot can roll through a field photographing 5,000 young plants a minute, using algorithms and machine vision to identify each sprout as lettuce or a weed. If that seems too impossibly fast to you, "it's well within the computing of machine learning and computer vision," says Jeremy Howard, founder of deep-learning outfit Enlitic. A graphics chip can identify an image in just .02 seconds, he adds.

With an accuracy within a quarter inch, the bot pinpoints and sprays each weed on the fly. If it eyeballs a lettuce plant and determines it isn’t growing optimally, it’ll spray that too (farmers overplant lettuce by a factor of five, so they can sacrifice plenty of extras). If two sprouts ended up too close to one another during planting (not ideal), the machine can discern them from, say, one particularly large plant, and zap them as well.

Now, consider the alternative: spraying a field with herbicides willy-nilly. “It's akin to saying if a few people in the city of San Francisco had an infection, your only solution would be to give every man woman, and child in the city an antibiotic,” says Ben Chostner of Blue River Technology. “People would be cured, but it's expensive, it's not using the antibiotics to the best of their potential.”

With the LettuceBot, on the other hand, Chostner says farmers can reduce their use of chemicals by 90 percent. And the machine is already hard at work—Blue River treats fields that supply 10 percent of the lettuce in the US annually.

Blue River Technology

LettuceBot is so powerful because it uses machine learning to make one of the few things robots are already great at even better: precision. Robots can’t run like us or manipulate objects quite like we do, but they’re consistent and meticulous—the perfect agricultural snipers.

Life From Above

Orbiting over 400 miles above your head, NASA’s Landsat satellites provide a downright magical survey of Earth’s surface in a slew of bandwidths far beyond the visible spectrum. All of these layers of information are hard to digest for a human, to be sure, but for machine learning algorithms, they ain’t no thing.

And that could be extremely valuable for monitoring agriculture, particularly in developing countries, where governments and banks face a dearth of data when making decisions about which farmers they give loans or emergency assistance to. During a drought in India, for instance, not only will regions suffer to different degrees, but within those regions some farmers might have better means to procure water than others.

So a startup called Harvesting is analyzing satellite data on a vast scale with machine learning, with the idea to help institutions distribute money more efficiently. “Our hope is that in using this technology we would be able to segregate such farmers and villages and have banks or governments move dollars to the right set of people,” says Harvesting CEO Ruchit Garg. While a human analyst can handle 10, maybe 15 variables at a time, Garg says, machine learning algorithms can handle 2,000 or more. That’s some serious context.

Choosing where to allocate resources is a particularly pressing problem for governments as a warming Earth sends the climate into chaos. Traditionally, farming in India has been a relatively predictable affair, at least as far as humans holding dominion over their environment goes. “So what I learned from my father, my grandfather, that's how I grow, these are the seasons I know,” Garg says. “However because of drastic climate change, things are no longer what my father or my grandfather used to do.”

It’s the new world order, folks. Farmers can take the punches, or they can farm smarter. More data, more AI, and more chemical-spraying robots.

As for those tomato plants you keep neglecting—that one’s on you, I’m afraid.