Skip to content
202412 Fresh Quarterly Issue 27 04 Machine Learning In Agriculture
Issue 27December 2024

Machine learning in agriculture

This branch of artificial intelligence can help pome- and stone-fruit growers extract actionable information from the data deluge. By Anna Mouton.

Deciduous-fruit production is a complex system of many moving parts. And while information is critical for decision-making, growers often find themselves drowning in the relentless stream of data generated by technologies ranging from soil probes to remote-sensing satellites.

“How do we bring all of this data together — that’s the big question,” said Prof. Adriaan van Niekerk, director of the Centre for Geographical Analysis in the Department of Geography and Environmental Studies at Stellenbosch University.

As a geographer, Van Niekerk sees location as the common denominator of the various agricultural data sets. “If you know where you’ve collected data — when you have coordinates — you can bring all the data together based on those coordinates.”

He believes geographical information systems, global positioning systems, and remote sensing offer an invaluable set of data-analysis tools.

“Geographical tools are important for the agricultural sector because we’re working over large areas,” he said. “But the problem is too much data. How do we make sense of it all?”

What is machine learning?

Machine learning is one type of artificial intelligence. Artificial intelligence is a broad term that also encompasses applications such as search engines, recommendation systems, speech recognition, chatbots, virtual assistants, self-driving vehicles, and large language models, of which the best-known is probably ChatGPT.

Van Niekerk explained that machine learning allows computers to learn from data without explicit programming. In traditional programming, the programmer codes a set of rules that the computer applies to data to solve a problem.

“But machine learning works differently,” he said. “You provide the computer with data, and it finds patterns in those data. Or you provide it with data and answers, and it finds the rules — it automatically builds a programme.”

Supervised machine learning is the most popular type in the agricultural sector. It has five steps: obtaining data; cleaning, preparing, and manipulating data; training a model; testing the model; and improving the model.

Although machine learning can effectively process the vast amount of agricultural data and is especially useful for finding relationships between disparate data sets, Van Niekerk highlighted an obstacle. “It requires enough training data, and that’s been a problem in the fruit industry for a long time.”

He reckons that gathering the necessary data represents about 60% of the effort required for machine learning, and preparing the data for analysis is another 30%.

“Training, testing and improving the model is relatively easy,” he said. “So, the fruit industry is doing most of the work when it comes to machine learning.”

Modelling apple yields and fruit size

Van Niekerk presented the results of a Hortgro-funded project to examine yield variability between trees. Part of this project looked at how early in the season apple yields could be predicted based on remotely sensed data.

The research team gathered yield data from 30 Fuji trees in three orchards. They used flower counts to choose trees representing a wide range of expected yields.

They also collected one 8-cm-resolution drone image, four 50-cm-resolution satellite images, and 15 10-m-resolution satellite images. Different image types were collected four, three, two, and one month before harvest.

“It was a very small data set, but we fed all of this into a machine-learning model,” said Van Niekerk.

The model performed best using only the 10-m-resolution satellite images as predictive variables. Unexpectedly, combining the drone and satellite images was less accurate than the satellite images on their own.

“We also applied the same kind of technology for fruit size modelling,” he said. “We could use satellite imagery to model the fruit growth during the season. Eventually, the accuracy of the model was within a few millimetres.”

Further than fruit

Many deciduous-fruit growers are already familiar with another machine-learning application, TerraClim, a climate and terrain model that integrates different data sources to provide field- and farm-level environmental information.

TerraClim started as a tool to help wine-grape growers select cultivars. “We fed data about which wine-grape cultivars are planted where into a machine-learning model to create an app for telling you which cultivars are most suited to user-defined fields,” said Van Niekerk.

“We assumed that some logic or experience went into establishing the 6 000 vineyards we used to train the model. So basically, we used people’s knowledge to train the model, and now the model is giving that knowledge back to others who want to learn from it.”

Subsequently, TerraClim expanded into a web-based service that can help agriculturists in different sectors better understand their sites’ growing conditions.

Van Niekerk shared several other examples of machine-learning projects, including differentiating annual crop types using remote-sensing data to predict yields early in the season and quantifying pasture biomass to manage grazing by dairy cows.

He was also involved in developing a web-based application to map waterlogging and salinisation based on satellite images. “Soil-property mapping using satellite imagery is difficult because the satellite can only see the topsoil,” he said.

A direct approach to analysing spectral properties of bare soils is possible, but this is infrequently applicable to permanent crops such as pome and stone fruit. So, Van Niekerk’s team used an indirect approach to measuring changes in vegetation, which successfully identified problem areas when applied to the nine South African irrigation schemes.

“You need a lot of data to build a proper model,” said Van Niekerk. “We’re still scratching the surface in terms of data and research about how we can use machine learning to benefit agriculture — there’s still a lot to be done.”

He concluded with an invitation to pome- and stone-fruit growers. “If you need a mad professor to look at your data, please send me an email!”

This article is based on a presentation at the 2024 Hortgro Technical Symposium. Go to the Hortgro YouTube channel to watch Van Niekerk and other speakers at this event.

Back To Top