Python-powered machine-learning tool drives robot farming project

Blue River Technology is using the Python-based machine-learning framework to develop smarter crop-spraying tech.

How machine learning is driving new 'smart' farming projects

New AI-powered farming machines trained on the PyTorch framework are being developed to help farmers produce more food with fewer resources.

Blue River Technology is using the PyTorch machine-learning framework to train robotic crop sprayers to identify and map weeds as they move through a field. Using a high-resolution camera array, the system instructs the machines exactly where to spray herbicide, killing weeds while leaving precious crops unharmed.

see also

Artificial intelligence in the real world: What can it actually do?

What are the limits of AI? And how do you go from managing data points to injecting AI in the enterprise?

Read More

The technology could provide instrumental in helping farmers meet raising food demand around the world with increasingly fewer land and water resources.

SEE: Hiring Kit: Python developer (TechRepublic Premium)  

PyTorch was originally built by Facebook AI, before being open-sourced by the company in 2017. The AI library was subsequently picked up by Microsoft, who announced in July 2020 that it would join Facebook AI as a maintainer of the platform, becoming the Windows build technical caretaker.

Powered in part by the Python programming language, PyTorch is an open-source deep-learning framework built to be flexible and modular for research. The library allows developers to build, deploy and add to new AI models at speed. 

117238994-753091168600041-7470395618077051512-n.png

A prototype of Blue River Technology's precision weed-control machine.

Blue River Technology

Chris Padwick, director of computer vision and machine learning at Blue River Technology, said PyTorch was used to train its See & Spray robotic farming system owing to its flexibility and the fact that it was easy to debug.

"New team members can quickly get up to speed, and the documentation is thorough," said Padwick.

"The framework gives us the ability to support production model workflows and research workflows simultaneously."

Blue River Technology's See & Spray machine combines machine learning and computer vision to identify weeds in real time. Each frame captured by the camera is analysed by a PyTorch-enabled neural network to pinpoint weeds and crops, and map their locations.

Traditionally, this can prove a challenge, as many weeds and crops are all but indistinguishable to the naked eye, explained Padwick. By harnessing machine learning, robotics technology could offer a more precise method of weeding crops, reducing the amount of herbicide used to control weeds and promoting more sustainable agricultural practices.

blue river technology machine learning weed crop

The cotton plants are in green and the weeds are in red. To the naked eye, they are nearly indistinguishable.

Blue River Technology

To train its machine-learning models, Blue River Technology consulted with agronomists and weed scientists to ensure weeds were labelled accurately. The company plans regular testing to improve its models' performance using the Weights & Biases platform, which makes it easier for engineers to visualize PyTorch models during training. 

"We have built a set of internal libraries on top of PyTorch, which allow us to perform repeatable machine-learning experiments," said Padwick.

"At the end of the day, we need to build the most accurate and fastest models for our field machines. PyTorch enables us to iterate quickly, then productionise our models and deploy them in the field."