AI is not magic, just plain hard work
Sounds easy — but data science is no magic bullet, it requires a lot of hard work, and a lot of labeled data. This takes time and effort. We needed to feed the pest detection algorithm with many iterations of labeled images, so it could gradually predict the pest type with increasing accuracy until it is fully trained to detect pests without any human intervention.
We first focused on the detection of whiteflies, since those were the majority of the insects on the glue traps. Plus, they are quite easy to detect by eye (even an untrained eye, such as that of our data scientist, managed to identify them on the glue trap). Still, it took two months of taking pictures, labeling, and training and retraining the algorithm. But by then, we managed to detect the whiteflies with an average accuracy of 99%. Quite cool!
Other pest types, like thrips, fruit flies, and sciaras, were also labeled in that period of time. This number was much lower than the number of whiteflies, but still enough to enable us to take our next step: to train our pest detection model to accurately detect these other pest types as well. That appeared to be more complicated, we did not reach the accuracy that we had with the whiteflies. So, the first idea: more pictures, more labels. But that did not bring the desired result either. Back to the hard work and common sense. We realized that the difference in accuracy might possibly be caused by the data labels. Could it be that labeling an insect using a picture taken by a camera would give other results than when you would look at the glue trap directly and note down each insect type?
With that thought, we added a step where we compared the manual counts on paper from the expert’s daily rounds with the labels he mentioned on the pictures. And indeed, we found a difference in paper count per glue trap and labeled count per picture of that same glue trap. A tiny insect like a thrip is far more difficult to distinguish on a photo than ‘in real life’.
So another manual step was needed: comparing the real glue traps and their pictures and adding the missing counts to the labeled data. We then retrained and finetuned the algorithm once more. And once more. And once more. But with a great result: accuracy of 93% for thrips.
More automation
With the achieved accuracy, it is possible to automate the daily or weekly count of insects on a glue trap. With that information, however, even more is possible. The pest detection application not only makes it possible to detect the type and number of flies but also gives insights into the location and increase or decrease of flies over time. A dashboard provides an overview of areas that require attention in the greenhouse, allowing the grower to take targeted preventive measures. Combined with the possibility to monitor the effect of those measures, the pest detection app thus enables cost reduction on expensive pesticides. And in the future, this can result in a fully automated pest detection process, monitoring the greenhouse on pests at any given time, enabling the expert to remotely access all required data to make (or confirm) decisions and use this data as evidence.
But when you have successfully applied or trained a model on a use case and you have proven that it works, you have spent about 10% of the effort required to productize it or embed it within a business process.
Read this article in Dutch on groentennieuws.nl