Sriganesh Srinivasan
← All work

Bird Feeder Detector.

Real-time bird species detection at a window feeder

2025–2026 · Solo · Archived

Code ↗
Bird Feeder Detector
Problem
I wanted to know which birds actually visit my window feeder, without watching it all day.
Built
A Raspberry Pi 2 with a webcam saves a frame only when something moves. I label the frames in Roboflow, train a YOLOv8 detector on Colab's free GPU, and run it on a laptop against the live feed, drawing a box, species and confidence for every bird.
Stack
Python, YOLOv8, PyTorch, OpenCV, Roboflow, Google Colab, Weights & Biases, Raspberry Pi
Outcome
The detector covers 8 classes (seven birds plus squirrels). The second model reaches 0.67 mAP50 and 0.80 precision on its validation set. Live tests exposed a heavy bias toward sparrows, which is the next thing to fix.

What it does

  1. Capture. A Raspberry Pi 2 with a Logitech webcam watches the feeder. Every few seconds it compares the new frame to the last one, and saves it only if enough pixels changed: a bird arrived, moved or left.
  2. Collect. New frames go to the cloud, first through Google Drive with rclone, later straight into Roboflow with its SDK.
  3. Label. In Roboflow, auto-label draws rough boxes and I correct them by hand.
  4. Train. The labeled set goes to a Google Colab notebook, which fine-tunes YOLOv8n on a free T4 GPU.
  5. Detect. On my MacBook, inference.py runs the trained model on the webcam feed through PyTorch’s Apple GPU backend. It draws a box with the species and confidence on each bird, and logs every session to Weights & Biases.

How it works

The work is split by what each machine is good at. The Pi 2 is far too slow to run a neural network, so it only captures. That also makes it simple enough to leave running unattended for days. Training happens on a borrowed cloud GPU, and live detection runs on the laptop.

Bird feeder detector pipelineA Raspberry Pi with a webcam saves frames when motion is detected and uploads them. They are labeled in Roboflow, a YOLOv8n model is trained on a Google Colab T4 GPU, and the trained weights run live on a MacBook, which draws boxes with species and confidence and logs sessions to Weights and Biases.RASPBERRY PI 2capture.pyWebcam at the feederSaves a frame onlywhen something movesROBOFLOWLabelAuto-label draft boxesfixed by hand8 classesGOOGLE COLAB · T4Train YOLOv8n50 epochs at 640 pxFree GPU, nothingto maintainMACBOOK · M1inference.pyLive webcam feedBoxes + species + confSessions logged to W&B
Dashed boxes are cloud services; the Pi and the laptop run on site.

Some choices along the way:

Results

Both models are YOLOv8n trained for 50 epochs at 640 px. These are each model’s scores on its own validation set:

V1 (March 7) V2 (March 27)
Precision 0.71 0.80
Recall 0.65 0.61
mAP50 0.65 0.67
mAP50-95 0.43 0.45

Validation scores only tell part of the story, though. The live tests below told me more.

What broke

Next projectSimpliSync →