coopwat.chthe secret life of chickens
GuestNot signed in
02 · HOW IT WORKS

From a camera to a sleep score

All the video work happens on a Mac at home. The website only ever gets the results.

The pipeline, from the camera to the site

AT HOME, ON THE MAC · FOOTAGE NEVER LEAVES
1

Cameras

Record all day and night.

Two Wyze Cam OG to SD cards. Only the hours needed are copied home.

2

The slow pass

Find every hen, once a second.

Frames are read at 640 px wide, 2 a second. A YOLO11 detector looks once a second, plus motion per hen. Saved, so it runs once.

3

Identity

Work out who is who.

Over the whole night at once. Every number after this depends on it.

4

The fast pass

Turn seconds into stories.

Asleep, awake, moving, hidden, then scores, meters and meals. Seconds to re-run.

IN THE CLOUD
5

The site

coopwat.ch.

Tables, report data and a few frames, sent every hour the Mac is awake.

The labeling loop: People name hens in frames on the site, and those labels go back to the Mac to retrain the detector in step 2.

Cameras get bumped. Each recording is matched to a reference view, and the zones move with the camera. When it can't be matched, that day is held back rather than published with wrong numbers.

THE HARD PART

One name, never on two birds

A detector looking at one frame at a time makes the same mistakes over and over. So Coopwatch looks at the whole night at once.

  1. Follow each bird second to second, so a sleeping hen becomes one track lasting hours.
  2. Pool the evidence along the track, trusting confident seconds most.
  3. Name tracks by elimination, strongest claim first.
  4. A bird it can't name stays unknown rather than guessed.
Hen AHen BUnknown: left unnamed duskdawn
Illustrative: not a real night.

Teaching it who's who

People label frames on the site: tap a box, then her name. A label counts as soon as one person saves it. The Mac pulls the labels home and retrains. Real nights are replayed against the owner's own labels to check the naming stays right.

“There was no clever shortcut: it took a lot of old-fashioned labeling and retraining.”

Sign in to help label frames.

538frames labeled on the site

Why these choices

YOLO11

Quick to iterate on, and fine-tuning it on a few hundred frames worked.

A Mac at home

Keeps footage at home and was the fastest way to start. A move to the cloud is being looked at.

A small website

Python on Google Cloud Run, with Cloud Storage and Firestore. Sign in with Google.

Scores from research

Sleep thresholds come from EEG studies of laying hens. See the sources. Sources

For the curious: moving the processing to the cloud

The processing could run in the cloud for about $3-15 a month. The hard part is getting footage off the cameras without someone copying SD cards.

OptionAbout $/monthTrade-off
Keep the Mac, automate the copy$0Fastest; the Mac must stay on
Raspberry Pi + a nightly cloud job$3-15Fits today's setup; batch, not instant
Cloud job with a GPU$10-25Quick, but not needed at this frame rate
All at home on a Pi 5 with an AI accelerator~$285 onceBest privacy; recompile after each retrain
Switch to RTSP camerasCameras + one aboveOfficially supported; a new purchase

Estimates from October 2026