Smart AI Cat Doors

by tomino342 in Circuits > Raspberry Pi

34 Views, 0 Favorites, 0 Comments

Smart AI Cat Doors

WhatsApp Image 2024-06-16 at 13.01.14_e5bbbf56.jpg

The AI Cat doors are automated cat doors that will open when my cat is detected in front of the door with AI, and open the door when cat is close enought.

Supplies

Things that i used:

Laptop, Raspberry pi 5 - 87€

Project kit for raspberry pi FNK0054 - 50€

Wood - 10€

Cardboard - 2€

Glue - 1€

Laser cutter - 10€

LCD Display - Free in kit

Servo motor - Free in kit

Infrared sensor - Free in kit

RGB light - Free in kit

Dataset Preparation

Screenshot 2024-06-15 232120.png

After the connection with the raspberry pi, I started focusing on the AI model. The AI model was trained using images of my cat and images of other cats. The images and videos were labeled in roboflow. I made 2 classes, my cat "Tai-Lung" and other cats "Other-Cat". After making the dataset, I will train it using YOLOv8s model.


Dataset that I used:

https://app.roboflow.com/tomas-6mrdn/tai-lung-detection/browse?queryText=&pageSize=50&startingIndex=0&browseQuery=true

Training AI Model

Screenshot 2024-06-15 225502.png

Model was trained with 150 epochs and precision for the "Tai-Lung" class was 94 % and for the "Other-cat" class it was 85%.

Downloads

Implementation Into Python Code

Screenshot 2024-06-15 232359.png

After training and downloading the code, I made a code for Python that will open camera that will start detecting my classes.

Downloads

Connecting Laptop Python Code to Raspberry Pi Code

Here, I made so that when the my cat is detected, it will turn the servo motor to open the door, shine the RGB light green, connected to the LCD display to show how accurate the model is and coded Infrared sensor that will detect the cat ouside the door. After the model detects my cat and also Infrared sensor is activated, then the servo motor turn and open up the door.

Maker Part

IMG-20240615-WA0214.jpg
IMG-20240615-WA0215.jpg
IMG-20240615-WA0216.jpg
IMG-20240615-WA0217.jpg
WhatsApp Image 2024-06-16 at 00.08.38_ea699b3a.jpg

For the DIY, I made simple prototype on how the door should look like and most important, how its gonna work.

The door will open when my cat is detected and also when the infra red sensor is activated. So in order there are 2 conditions that needs to be true to open up the door. Red light on the rgb will shine when there is no detection and other cat is detected. LCD Display will show accuracy of the model on the predicted class.