The main goal was to develop a system, which detects pigeons and runs on a Raspberry Pi. It should be able to trigger an output to scare away the pigeons.
Why do we want to scare away pigeons?
Mainly there are two reasons for this: First of all, imagine yourself sleeping on a sunny sunday. You had a tough week and want to sleep late. Everything is fine until you`re suddenly awoken by the annoying sound of a pigeon. The sleep is gone and so is your good mood.
Second, if you want to help smaller birds to survive by feeding them you may have recognized that pigeons aren't far away. You can fill the feeder, and after a day it is emtpy because some hungry pigeon couldn't withhold.
To solve this problem without frightening away the "wanted" birds we developed this cool project.Basic Idea
After deciding what basic system we wanted to develop, we thought about what hardware we wanted to use, and which hardware could be used outdoors without a power plug. The hardware we chose to use was found fast - a Raspberry Pi 3 B+ with an Intel Neural Compute Stick.
We wanted to distinguish between pigeons and all other bird species. Therefore, it was necessary to train a TensorFlow model which detects only pigeons.
This project was created as the content of lecture "Applied Artifical Intelligence," supervised by Dionysios Satikidis and Jan Seyler at the University of Applied Sciences Esslingen. All hardware was provided by the lecturers. This text covers the design, implementation and testing aspects of AI applications and models in context of a full-stack survey.
The following steps shall give you a brief overview over the necessary steps. For further details look at the README.md on our Github-Page.
I. Collecting the data to train our own object-detector
First of all we collected images of pigeons from Google. Because the result was not satisfying enough, we used a camera that triggers on movement to take images of pigeons in their "real" environment.
After collecting enough images, it was time for the most fun part of the project: Labeling the images so that the object-detector knows how a pigeon looks like.
After hours of work we made it through the pictures and could start training our own object-detector.
II. Training the Object detectorwith the TensorFlow Object Detection API
The actual training was done on a Laptop with a GPU. The training process took roughly 5-6 hours. The result of this part was a custom trained object detector, based on a pretrained model.
The pretrained model, that forms the base of our pigeon-detector is called "ssd_inception_v2_coco". We chose this one because it is a very lightweight and thus fast model, that yields a sufficient accuracy for our use-case.
After testing our Model on the training machine we had to convert it for usage with the Intel Neural Compute Stick on the Raspberry Pi.
III. Converting the model to use it on a Raspberry with the NCS2
The Neural Compute Stick is not able to run TensorFlow models directly. You have to first convert them to a format that the NCS2 understands. Intel provides a program called "Model Optimizer" for this. It basically takes the TF model and converts it for the architecture of the NCS2.
IV. Moment of truth
Finally the moment had come. We took our trained model and copied it on the Raspberry Pi. Here you can see the result:
V. Defend the bird house
Now that we are able to detect the pigeons we could trigger one of the GPIOs on the Raspberry Pi. We turned on a little LED along with a beeper, whenever a pigeon was detected. But the possibilities are endless.
VI. Adaptive aspects of the product
The way we implemented this project makes it very easy to connect every actuator that the user wants to use. The user is not limited to stick to an LED or a small loudspeaker. Furthermore, the user can easily retrain the model on a custom dataset, making it detect whichever object the user wants to detect.