How AI Promises a Cleaner World

by Ahmad Muqry Hasni

(Boom Sprayer, 2021)

You are witnessing one way of removing unwanted plants from a farm — boom spraying (Government of Western Australia, 2021). The nozzle splits the herbicides into tiny droplets that are projected through the air to the target.

While this method can cover huge farmlands, corner-to-corner, edge-to-edge, in no time, it bears a long-term exponential detrimental impact on Earth. The tiny droplets of herbicides are meant to kill weeds, but what if they unintendedly land on crops? Will the crops die too? Well, they would not. A specific herbicide is developed to kill a specific weed, leaving other plants unharmed. So, our delicious fruits and vegetables are safe! That is why boom spraying is ‘okay’, which is famous for removing weeds while ensuring crops are unharmed.

Do you notice something unusual?

There are unnecessary herbicides usage, the ones that land on crops. I will call ‘unnecessary herbicides’ a kind of ‘waste’ for simplicity in reading. These wastes are negligible if we talk about growing cabbages in your backyard. But we are growing food on 5.0 billion hactares of land (FAO, 2020) to feed 7.7 billion people, and the amount of ‘waste’ is astronomical. 2 million tonnes of chemicals are used annually; most of which are herbicides (50%), followed by insecticides (30%), and fungicides (18%) (Europarl, 2021). Even in the best-case scenario, where 99% of herbicides were effective (landed on weeds), we would have still channelled 0.02 million tonnes of herbicides, equivalent to roughly the mass of 6,700 Honda Accords, to the environment!

We have pictured ‘astronomical waste’ by examining an exceptional case of high-efficiency weeding and extrapolated that the best-case scenario still yields an unfavourable impact on our planet.

But it was not a concern until it started to rip away human health.

Herbicides’ detrimental effects on human health depend on several variables, including their chemical class, dose, duration, and route of exposure. Both large and low doses of herbicides can be harmful to people. Long-term exposure can have various adverse health impacts, including the development of diseases including cancer and neurological disorders, alterations in the reproductive and developmental processes, and respiratory problems. According to researchers’ estimates, the herbicides found in food are to blame for 35% of all cancer incidences in the U.S. population (2013).

The distribution of sample proportion and the central limit theorem (2022a) makes it statistically reasonable to estimate that the probability of getting cancer from the inefficiency of weeding is 35%. In essence, roughly 4 out of 10 cancer patients resulted from inefficient weeding.

As aforementioned, this is an exponential detrimental impact, which means that the probability tends to increase as time passes; we produce more humans, and more humans need more food, more food means more farms, and ultimately we need to use more herbicides.

Since the exponential rate of human growth is inevitable, does that mean the case is also unstoppable? And we all are going to die of cancer someday tomorrow? Hold the horses!

Tracing back to our initial discussion, generic spraying is the root of the inefficiency, and if we can replace generic spraying with targeted spraying, in which we spray only weeds. No more unnecessary herbicide droplets will land on crops. Problem solved!

(Celebration Meme, 2018)

Yay! We saved humanity!

Not quite.

How will we build a machine that can perform targeted weed spraying?

How will it accurately differentiate between a crop and a weed?

And how does it accurately localise weeds on a farm?

The term ‘accurately’ plays a significant role in defining the success of this solution. If the machine exists but cannot perform the job accurately, there is no difference with the boom sprayer. The robot must understand its surroundings through cameras, which can be achieved using an object detection model powered by a neural network. A neural network (N.N.) is an algorithm based on Artificial intelligence (A.I.). A.I. is a concept emulating human intelligence in devices designed to behave and think like humans (2022b). The phrase can also refer to any computer that demonstrates characteristics of the human intellect, like learning and problem-solving. As we dive into how A.I. sits at the core of our solution, I will use some technical terms to make our discussion more precise. Don’t worry if these terms sound intimidating to you, as I will include their definitions in this article.

‘Learning’

That is the crucial feature of N.N. that will propel our solution towards success. It is programmed to behave like a human intellect — one can be better at something through training. The same goes for the N.N. Our N.N. will learn from a dataset of weed images to recognise and localise different types of weeds and differentiate them from crops. When the robot can do these, it can move its nozzle and aim at only weeds. The more the data, the higher the accuracy and the lesser ‘waste’ we will be producing from farming. Hence, the quantity of herbicides used is directly proportional to the number of weeds on a farm. Herbicides will not be over-consumed or under-consumed; it is optimised!

A fully connected layer neural network

You are looking at a visual representation of a simple neural network. Learning is a general term when we are training an N.N. model. But when training a deep neural network, a neural network with much more hidden layers, we use another more specific term called deep learning. To kickstart your understanding of how N.N. learns to detect a weed, we will start with how N.N. detects a weed by exploring its workings in a straightforward case.

A single node neural network

Let us take an example of a neural network model to predict a particular day as a rainy or sunny day based on air temperature. There is no doubt that weather forecasting involves a complex analysis of many factors, but for the sake of building a stable foundation of the inner workings of a neural network, we will consider only one factor mentioned above, and we will get into a more realistic example soon in another article. From the image above, we have a simple neural network model that consists of only one input node, one hidden layer and one output node. The model predicts a day as a rainy day through forward propagation. The air temperature value for a particular day will be multiplied by weight, m. Then, the value will be converted into a value ranging from 0 to 1 by a sigmoid activation function to give us the probability a day will rain. We can set a threshold value of 0.75 where if our model predicts a probability lesser than the threshold value, we will classify that day as not rainy. A value closer to 1.0 indicates a higher probability a day will rain.

This is what our model looks like in a mathematical equation.

The weight is the crucial parameter that affects the accuracy of the model’s prediction. So, we will be adjusting it through learning, precisely backward propagation. Our model will learn from training data and I have created an artificial dataset to aid our discussion.

Artificial Training Data

Based on the diagram above, I assigned the actual probability a day will be rainy for a day we have observed it rained is 0.99. The probability of a new day being rainy is what our model will predict. Our model learns in three steps: forward propagation, backward propagation and parameters optimisation.

We will initialise our model with random values of m and c. Then the training data will be forwarded into the model to calculate the probabilities for each data, called the predicted probabilities.

Realised that now we have two types of probabilities? The actual and the predicted probabilities. We can optimise the parameters by seeking to minimise the difference between the actual and the predicted probabilities. I will refer to the difference as randomness as it is a more precise word to describe how far a predicted probability is from its actual probability. With regards to our problem, we are solving a binary classification problem, and for that reason, we will use the binary cross-entropy loss function.

The what?

The binary cross-entropy loss function is one of many ways to measure how far a predicted probability is to its actual value.

Binary Cross Entropy Function

By substitution, we obtain the loss function in terms of m. Our goal now is to find the value of m with the minimum loss value (randomness in a predicted probability). If you are guessing to use derivatives in finding the optimum value of m, then you are right! By finding the minimum point of the loss function, we can find the value of m, which produces the smallest loss value. Below demonstrates the calculation in finding the optimum value of m in terms of input value, x and actual probability, y.

Minimum Point of the Loss Function

That is how our neural network learns to predict the probability a particular day will rain. And the concept applies to developing an N.N. that can identify different types of weeds on a farm. Except, the architecture of the model is more complex than our example.

SSD-Mobilenet Architecture

Above is the architecture of a deep neural network named SSD-Mobilenet. That is the model that I have used in developing a weed detection model. It constitutes more than just a basic neural network, such as a convolutional neural network, a type of N.N. explicitly designed to learn patterns of images.

In a nutshell, we have discovered how A.I. promises a healthier and cleaner world by examining what and how it does in a straightforward case. The proposed solution does have some limitations that erect a barrier to realising it on a global scale. Training a neural network to identify many different weed species demands an enormous amount of training data, and gathering them is one of the most challenging tasks in machine learning engineering. To build on that, building a robot that is mechanically capable of operating at different terrains is absolutely costly and engineering extensive. However, our analysis unveiled the existence of hope for a cleaner and healthier future.

References

  1. A.G. (2022a, June 28). What Is the Central Limit Theorem (CLT)? Investopedia. Retrieved August 21, 2022, from https://www.investopedia.com/terms/c/central_limit_theorem.asp#:%7E:text=Key%20Takeaways-,The%20central%20limit%20theorem%20(CLT)%20states%20that%20the%20distribution%20of,for%20the%20CLT%20to%20hold.
  2. Boom Sprayer. (2021, June 10). [Photograph]. Department of Primary Industries and Regional Development, Government of Western Australia. https://www.agric.wa.gov.au/sites/gateway/files/sprayer.jpg
  3. Celebration meme. (2018, September 13). [Illustration]. VMO Rock. https://vmo.rocks/wp-content/uploads/2018/09/we-did-it-celebration-meme.jpg
  4. Department of Primary Industries and Regional Development, Government of Western Australia. (2021, June 10). Herbicides Application. Retrieved August 21, 2022, from https://www.agric.wa.gov.au/grains/herbicide-application
  5. Food and Agriculture Organisation of The United Nations. (1995). Crop Production and Natural Resource Use. Retrieved August 21, 2022, from https://www.fao.org/3/y4252e/y4252e04.pdf
  6. Food and Agriculture Organisation of the United Nations. (2020, May 7). Land use in agriculture by the numbers. Retrieved August 21, 2022, from https://www.fao.org/sustainability/news/detail/en/c/1274219/#:%7E:text=Globally%20agricultural%20land%20area%20is,and%20pastures)%20for%20grazing%20livestock.
  7. J.F. (2022b, July 6). Artificial Intelligence (AI) Definition. Investopedia. Retrieved August 21, 2022, from https://www.investopedia.com/terms/a/artificial-intelligence-ai.asp#:%7E:text=Artificial%20intelligence%20(AI)%20refers%20to,as%20learning%20and%20problem%2Dsolving.
  8. M.A.M.-M., B.C.V.-C., & M.M.H. (2013, June 12). Toxicity of Herbicides: Impact on Aquatic and Soil Biota and Human Health. Intechopen. Retrieved August 21, 2022, from https://www.intechopen.com/chapters/44984
  9. Policy Department, Directorate-General For External Policies, European Parliament. (2021, January). The use of pesticides in developing countries and their impact on health and the right to food (№978–92–846–7673–6 (pdf)). https://doi.org/10.2861/28995(pdf)

--

--

Kolej Yayasan UEM Research Institute

On a mission to encourage Malaysian youths to tap into their intellectual curiosity and shape ideas that can make a positive difference in the world.