Skip to content

Asian Hornet Detection with YOLOv10n: A Guide to Building a Raspberry Pi 4 Arducam Detector

License

Notifications You must be signed in to change notification settings

vespCV/hornet3000

Repository files navigation

Vespa Computer Vision: Detect Asian Hornets on Rasberry Pi

This project focuses on building a computer vision model on a headless Raspberry Pi to detect Asian hornets (Vespa velutina) in the field. This approach allows for continuous data collection without requiring constant monitoring. Analyzing the images afterward provides flexibility in identifying hornets and reporting them on waarnemingen.nl (observations.org).

Project Summary

  • The Raspberry Pi operates headless, functioning without a monitor or keyboard.
  • It can be configured to capture an image at regular intervals (e.g., every 15 seconds) during active time.
  • If a Asian hornet is detected, the image with a timestamp is be saved to a microSD card.
  • Captured images are stored on a microSD card for later retrieval.
  • Step-by-Step Instructions for Building a Hornet Detector

Table of Contents

Goal of the project

Aim: Detection system using a Raspberry Pi 4 to capture images of Asian hornets with high accuracy (target: 95% accuracy, with a maximum of 5% false positives where other insects are misidentified as Asian hornets). These images will be used for reporting on waarnemingen.nl.

Content Description

  • manuals:
  • colab: code to make the model in Colab and the yaml file.
  • content_data3000_ date: Results of the training with confusion matrix and best- and last weights file.
  • codeLocalComp: Code on local computer to check images and test the model with a slideshow and with USB camera.
  • codeRasberryPi4: Code to test the installation Torch and the CSI camera, test the model with a slideshow and use the model with the CSI camera.
  • test: Images, slideshows and video's that can be used to test the model.

Other resources

Background

The Asian hornet (Vespa velutina) is an invasive alien species that has been found mainly in the southern part of the Netherlands for several years. The hornet is harmful to honeybees, bumblebees, and other pollinating insects.

More information about the exotic invasive Asian hornet in the Netherlands can be found on:

Datasets

Images for the training and validation were collected mainly from waarnemingen.nl (observation.org) with the settings alleen goedgekeurd and alle deelbare licenties.

The dataset is stored on Kaggel.

Images for testing also include other insects and are stored in the folder test

Model

The model was trained with yolov10 in google colab. YOLO is a fast and accurate object detector. It was chosen for this project due to its speed and simplicity, making it suitable for real-time hornet detection. Inspired by https://github.com/computervisioneng/train-yolov10-custom-data-full-guide.

Validate the model

Confusion matrix

confusionmatrix

Example of predicted data

predicteddata

Test the model on a slider with images or movie

Make a slideshow of test images (or download from the dataSlider folder hornet3000.m4v).

Install yolov10, click here for instruction

Use the test_slider.py on your local computer, click here for more information

Demo

Input from slideshow

A bounding box, class and conficence is show. This can be used to finetune the confidence levels.

Slideschow of the first model

Input 16MP CSI camera

The camera is taking images from the right side of the screen (showing hornets from waarnemingen.nl). On the left side the captured image of the camera and the inference. When a class 0 (Asian hornet) is detected the picture is saved under the name and timestamp in the folder imaged (bottom left).

Test the detection with 5 sec interval

To do

  • Optimize confidence threshold in the wild
  • Add insects to the model if needed (false positive hornet detections by other species)
  • Optional: connection with smartphone
  • Optional: simplify installation process

Acknowledgements

Yolov10 training of the model is based on https://github.com/computervisioneng/train-yolov10-custom-data-full-guide