
Gardening: welcome to a world of pests you never knew existed or previously ignored. Slugs are no exception but the story is different when your beautiful vegetables are decimated by these nocturnal noshers. Hackaday user Tegwyn☠Twmffat is well versed in the garden battle and decided to use machine learning to even the score. The high-level idea is to detect a slug in the garden and then ‘remove’ them with a ‘humane’ intervention.
Ai slug detection involves using a high end web cam to capture live video images of the crops or seed trays and streaming those images into a specialist computer, not much bigger than a Raspberry Pi, which then uses a pre-trained ‘model’ to identify slugs and draw a boundary box around each and every one of them. The boundary box is essentially a set of four coordinates which can then be exported to another system such as a high powered laser to kill the creatures as quickly and humanely as possible.
To start, thousands of images of slugs were captured (10,000+), cropped and edited and then used to train a deep neural network. Both the DetectNet object detection model from NVIDIA and the YoloV3 real-time object detection models were explored. In the current iteration, the DetectNet model was trained on 10,000+ images for 13 hours on the AWS NVIDIA V100 GPU. The model is currently detecting slugs on leaves!! That said, it seems to identify the markings on the slug as opposed to the antenna or the slug’s body. Probably because slugs are basically amorphous blobs. If you’d like to keep tabs on this project you can follow Tegwyn☠Twmffat sluggish updates on hackaday.io.
The slugs are now house trained. 10605 images of slugs have created a fairly good slug detector…The training shows obvious convergence, even though testing in real life does not pick up on the overall shape of the slugs, but more readily on the patterns on their bodies. Training on AWS Nvidia V100 GPU took about 13 hours to reach 500 epochs.