birdy

About this record A camera at the window, one sheet a day, a column per feeder

Notes

Sintra, October 2026

Why

There is a feeder outside my window in Sintra and I wanted to know who comes to it. Not roughly, not "the blue tits are back", but which species, how often, at what hour, with a photo for every visit.

The first part is that this is a weekend's build. A Raspberry Pi, the standard camera module, a shower basket with suction cups to hang it on the glass, and a feeder a metre away. The code watches a low-resolution stream for movement, takes a still, asks two small models running on the Pi whether it is a bird and which one, and files the answer. Nothing leaves the house except the photos I choose to publish.

The second part is the one I care about most. A record of one window is a diary; a record of several windows is a dataset. Every feeder that joins gets a column on the daily sheet, so the same species can be compared across gardens on the same day: who had the goldfinches, when the robin starts, what arrives first after rain. It is a collaboration between friends who happen to have windows.

The third part is honesty. The models run on the Pi and they are wrong sometimes. The record keeps the confidence of every guess, the review page lets us hide or delete, and nothing is averaged away. A sheet with a visible mistake is worth more than a chart that hides one.

If you have a window, a feeder and a free weekend, there is a column waiting.

How it works

  1. The camera streams a small 320×240 picture. Inside a region you draw around the feeder, each frame is compared with a slowly updating background. Enough change there is a trigger; everything outside the region (curtains, branches, reflections) is ignored.
  2. The camera takes a full-size still.
  3. A small model on the Pi (MobileNetV2 trained on ImageNet) looks at the crop around the drawn region and gives the probability that it is a bird, summed over every bird class it knows.
  4. A second, shape-based detector (EfficientDet-Lite0, trained on COCO) catches the birds the first model misses. BioCLIP 2 then names the species, scored only against the birds people have reported near the feeder on iNaturalist.
  5. Photo and thumbnail are filed on the Pi's card, and a row with time, species and both confidences goes into SQLite; consecutive photos of the same bird are grouped into a visit, which gets one species name and one alert. A page on the home network shows the day's captures, lets the household tune the region and thresholds live, correct a wrong name, and delete what is wrong. Optionally a Telegram message goes out for chosen species.
  6. The best photos of each species, per day, are shrunk to 1600 px and copied with rsync into that feeder's folder on a plain web server. These gallery pages read each folder's manifest in the browser; the server runs no code.
camera ─▶ motion in the drawn region ─▶ still photo
                                             │
          bird or not?   MobileNetV2 + detector ◀┘
               │
          which species?   BioCLIP 2, local iNaturalist list
               │
          row + photo + thumb ─▶ SQLite ─▶ review page
               │
          best of the day ─rsync─▶ web server ─▶ here

The rig

The Pi and its camera in a shower basket hung on the window glass; the feeder a metre outside.
Computer
Raspberry Pi 4, Raspberry Pi OS Lite (64-bit)
Camera
Camera Module v2.1, 8 MP, fixed focus from about a metre to infinity, no night vision
Power
The official USB-C supply
Storage
A microSD card, 16 GB or more; photos live on it
Mount
A shower basket with suction cups, found by chance. It hangs on the window glass and holds the Pi and the camera at exactly the right height
Outside
A feeder about a metre from the window
Cost
About €100 all in, less if a Pi is already in a drawer

The lens sits flush against the glass, indoors, so there is no weatherproofing to do. The camera only runs between sunrise and sunset; at night the camera rests. This is one working setup, not the only one. Any 64-bit Raspberry Pi (a 3, 4, 5 or Zero 2 W; the small ones are slower) with an official camera module or another libcamera-supported sensor will do; the v3 and HQ modules focus better on a feeder farther from the glass. USB webcams are not supported.

Join the record

You need a 64-bit Raspberry Pi with a camera module, a window with a feeder outside it, and a home network. You get a column on the daily record next to the other feeders, your own monthly sheet, and your birds on the species cards.

Your Pi keeps its own photos and database. Within a quarter of an hour it copies its published photos and a manifest to its own folder on the shared server over an SSH key that can reach only that folder. Nothing else is shared, and you choose what is published from your review page.

If you want in, contact me and I will set up your folder on the server and send you the install notes.

Code

The code lives in a private repository while the project settles. Collaborators get access along with their folder on the server.

Python 3.13 on the Pi: picamera2, OpenCV, LiteRT (TensorFlow Lite), SQLite, FastAPI, rsync. The gallery pages are plain HTML, CSS and JavaScript with no build step and no dependencies.

References and credits

Inspiration
thjkral/BirdDetection, the project that showed a Pi and a camera could do this
Bird gate
MobileNetV2 1.0 224, quantised, from the TensorFlow hosted models (paper). Apache-2.0
Bird detector
EfficientDet-Lite0 (COCO) from google-coral/test_data. Apache-2.0
Species
BioCLIP 2 (Imageomics Institute), run on the Pi as an int8 ONNX model against bird names from iNaturalist. MIT
Camera
picamera2 and libcamera, Raspberry Pi
Inference
LiteRT (ai-edge-litert), Google; ONNX Runtime, Microsoft
Daylight
astral, for sunrise and sunset times
Review page
FastAPI, serving the Pi's own pages
Server
Caddy, serving static files
Type
Libre Franklin by Impallari Type and Courier Prime by Quote-Unquote Apps, both under the SIL Open Font License
Photos
© each feeder's owner