Garden Pest Control with Machine Learning #SlugsSuck #DetectNet #MachineLearning #ArtificialIntelligence #DeepLearning #NVIDIA @hackaday

Photo from “FugSlucks™ 2019” by Tegwyn☠Twmffat on


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

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.

Join Adafruit on Mastodon

Adafruit is on Mastodon, join in!

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 36,000+ makers on Adafruit’s Discord channels and be part of the community!

CircuitPython – The easiest way to program microcontrollers –

Maker Business — Chip inventories rise as demand falls

Wearables — Go insane with a membrane (button or keypad)

Electronics — Shift away from basic arithmetic

Python for Microcontrollers — Python on Microcontrollers Newsletter: CircuitPython 8.0 RC 1 Out, Board Guides, and Much More! #CircuitPython #Python @ThePSF @micropython @Raspberry_Pi

Adafruit IoT Monthly — Cat Doorbell, Deep Algae Bloom Detector, and more!

Microsoft MakeCode — MakeCode Thank You!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — JP’s Product Pick of the Week 1/31/23 Feather RP2040 Scorpio NeoPXL8 Driver @adafruit @johnedgarpark

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at !

No Comments

No comments yet.

Sorry, the comment form is closed at this time.