On a block in San Francisco’s SoMa district, near LinkedIn’s headquarters and dozens of startups, a 180-year-old company best-known for making tractors has a gleaming new Silicon Valley office. But inside, instead of building the latest app, John Deere is focused on how to use artificial intelligence to make farming equipment that can meet modern sustainability and food production challenges.

John Deere Labs, which opened its doors in the spring, made its first major deal on September 6. The company spent $305 million to acquire Blue River Technology, a startup with computer vision and machine learning technology that can identify weeds–making it possible to spray herbicides only where they’re needed. The technology reduces chemical use by about 95%, while also improving yield.

It’s one step in John Deere’s embrace of “precision agriculture,” the use of technology to target crops and soil for optimum productivity and health. The manufacturer began incorporating aspects of precision agriculture more than two decades ago, building self-driving technology into tractors long before it started showing up in cars. But advances in AI mean that farm equipment can change more significantly now.

“What Blue River Technology allows us to do is move to the plant level, and start managing at that plant level,” says Alex Purdy, director of John Deere Labs. “That’s going to have transformative power in agriculture both in terms of yield but also in terms of cost for growers.”

Blue River knew that it had developed the most advanced technology of its kind in the industry, but chose to work with John Deere to reach the next step. “It was time to scale,” says Willy Pell, director of new technology at Blue River Technology. “And that means making lots and lots and lots of big pieces of metal. It’s not just buying new servers.” Rather than developing its own brand, the startup also realized that it made sense to partner with a company that farmers already trusted (though John Deere, notably, has also been criticized in recent years for selling farmers tech-laden tractors that it won’t let them fix on their own).

The technology will be marketed first to cotton growers, who are struggling to deal with weeds that have developed resistance to the chemicals in conventional herbicides. “There are all kinds of weeds developing that you can’t kill with Roundup anymore,” says Pell. Before, farmers would try to use Roundup along with “Roundup-ready” cotton designed to tolerate the chemicals. Now, using computer vision tech to identify and spray only weeds, farmers can switch to other herbicides–including, potentially, organic herbicides that the weeds haven’t evolved to resist (and that might otherwise kill the cotton, if they were sprayed everywhere). By killing weeds precisely, crop yields can double–even as herbicide use radically drops. The company plans to target soybean growers next.

For farmers, the new “see and spray” technology for herbicides may be most interesting because it can save money while producing a larger crop. But the company says that farmers also recognize a need for more sustainable alternatives. “You can imagine that growers see dollars and cents when they see a 95% reduction in herbicide spend–that clearly gets them interested,” he says. “But with everything we’re seeing in the last year with herbicide resistance as well as drift, this is becoming a much more important sustainability play as well.”