Embedded computer vision
Pest detection on a Raspberry Pi
A YOLOv5n model with attention that spots crop pests in real time on a Raspberry Pi. I quantized and pruned it so it would run fast enough on the Pi.
Python
PyTorch
Ultralytics
Raspberry Pi
Techniques: YOLOv5n, Attention, Quantization, Pruning, Segmentation
View the code


The problem
Pests are small, often hidden behind leaves, and the hardware in a field is cheap. The model has to be accurate on tiny, occluded objects and still run in real time on a Raspberry Pi.
How I built it
- 01Started from YOLOv5n and added attention mechanisms so the model focuses on small, partially hidden pests.
- 02Quantized and pruned the network for embedded deployment, cutting the compute load while keeping accuracy.
- 03Combined detection with segmentation to handle occluded pests in cluttered scenes.