Sprinkler System activated (top left and bottom right) after 10secs | Confidence Level set to 60%

🕊️ Pigeon Detection & Deterrent System

A practical computer vision project that detects pigeons in live video and automatically triggers a deterrent response. It uses a custom YOLOv5 model trained on annotated pigeon footage, running on a Raspberry Pi with a connected camera and Shelly device to activate a water spray when birds are detected.

Designed for real-world automation and edge AI experiments, the system captures video, processes detections locally, and logs events for later review. It also includes a lightweight Flask-based control interface, allowing settings such as detection confidence, video source, and device configuration to be updated without changing code.

✨ Key Features

  • Detects pigeons in live video using a custom YOLOv5 model
  • Runs locally on a Raspberry Pi for edge deployment
  • Triggers a Shelly-controlled water spray deterrent automatically
  • Saves pre- and post-detection video clips for review
  • Includes a Flask web interface for live configuration changes
  • Supports watchdog monitoring and automatic restart if needed

🔍 How It Works

Video is captured from a connected camera and analysed frame by frame using a trained pigeon detection model. When a pigeon is identified with sufficient confidence, the system logs the event, saves the relevant footage, and sends a command to the Shelly device to activate the spray deterrent. Configuration settings can be updated through the web interface and reloaded without interrupting the wider workflow.

🎯 Practical Uses

This project is useful for garden protection, balcony monitoring, building maintenance, and small-scale smart deterrent systems. It provides a strong example of how computer vision, embedded hardware, and simple automation can be combined into an effective real-world AI application.

Tech stack: Python, YOLOv5, OpenCV, Flask, Roboflow, Raspberry Pi 5, and Shelly automation.