← All work

The Four-Leaf Clover Project

Grow a tray of clover, train a model while it grows, then let the model hunt.

Aug 2026 – ongoingPersonalStage 2 of 7 · learning the fundamentals · seeds not ordered yet

Goal

Find four-leaf clovers with a model I trained myself, on plants I grew myself. Not a demo on someone else's dataset: a tray of clover on my windowsill, photographed every week, and a detector that has to find the rare one in it.

Why

I've shipped a lot of things that call a model. I hadn't trained one. I wanted a project where I couldn't hide behind an API, where I'd have to understand what a label is, why a test set has to be real, what precision actually costs you when the thing you're looking for almost never appears.

My first idea was a Rubik's cube solver. I dropped it in a day: the solving part is a known algorithm, not learning, and the vision part is easy. A four-leaf clover is the opposite. Three-leaf clovers are everywhere, four-leaf ones are famously rare, and telling them apart is a small, real, rare-object problem. It's also faintly ridiculous to grow a lawn indoors in Vancouver in the fall to make a dataset, which is part of why I like it.

The rule I'm holding myself to: every number on this page comes from my own runs or a cited source. If the model is bad, the page says the model is bad.

How it works

Two stages, because one-stage rare-object detection is a trap.

  1. Stage 1 finds every clover head in a photo. Clover heads are common, so this is an ordinary detector with plenty of examples.
  2. Stage 2 takes each crop and answers one question: three leaflets or four? A small classifier on a tight crop, which is where the rare-class problem actually lives.
  3. Data: real photos only in the test set. Copy-paste augmentation (pasting real four-leaf crops into real backgrounds) is allowed in training only, and every composite is tagged so it can never leak into evaluation.

Where I am right now

I built the labeller first, because I couldn't find one that was just a file. It's a single HTML page: drop photos in, draw boxes, press 1–9 for the class, space when done, export COCO or JSONL. Now I'm using it on clover photos I didn't take, to learn the fundamentals: what a good box looks like, how much data stage 1 needs before it stops missing heads, what the confusion matrix looks like when 99% of your crops are the boring class. Nothing here is on my own plants yet. The seeds aren't even ordered.

Timeline

7 stages. Newest at the bottom.

  1. doneAug 31, 2026

    Build the labeller

    One self-contained index.html. No build, no server, no dependencies. Boxes are stored normalised 0–1 so they survive any resize, work persists in localStorage, and there's a self-test mode so I know it's not lying to me.

    Build the labeller: The labeller: to-label strip on the left, done strip on the right.
    The labeller: to-label strip on the left, done strip on the right.

    Learned

    • A labeller is a UX problem more than a CV problem. Keyboard-only labelling is roughly 3× faster than mouse-only, so the hotkeys came first.
  2. nowSep 2026

    Learn the fundamentals on other people's clovers

    Label a few hundred public clover photos. Train stage 1 to find heads. Train a first stage-2 classifier on whatever four-leaf crops I can find online, knowing that set is tiny and biased. The point of this stage is not a good model, it's understanding why the first one is bad.

    Learned

    • I confused vLLM (an inference server) with VLM (a vision-language model) on day one. Writing that here so I never do it again.

    Open questions

    • How many labelled heads does stage 1 need before recall stops climbing?
    • Does class-weighting or oversampling matter more for stage 2 at 1:100 imbalance?
  3. nexttarget: early Sep 2026

    Buy seeds

    White clover (Trifolium repens), the plant four-leaf clovers actually come from, ideally a cultivar selected for extra leaflets. A gotcha I found while shopping: a lot of what's sold online as "four-leaf clover" or "lucky clover" is Oxalis, a different plant that always has four leaves and would make the whole project pointless. Plus a tray, soil, and a cheap grow light, because it's fall in Vancouver.

  4. latertarget: mid Sep 2026 · germination typically 7–14 days per seed packets

    Plant and wait for germination

    Sow, keep it damp, take one photo a day from the same angle. The daily photos are the beginning of the real dataset, even before there's anything to detect.

  5. latertarget: Oct–Nov 2026 · roughly 6–8 weeks to photographable leaves

    Grow, photograph, label

    Weekly photo sessions become the real test set. Every head gets a box and a leaflet count. If a four-leaf one shows up, it gets photographed from every angle it will tolerate, and it only ever goes in the test set.

  6. latertarget: Nov 2026

    Train v1 for real

    Retrain both stages with the windowsill photos in the mix. Report recall on heads, then precision and recall on the four-leaf class, on real photos only. Publish the confusion matrix whatever it says.

  7. latertarget: late Nov 2026

    The hunt

    Point the model at the tray. Count what it finds. Check every claim by hand. Then the honest comparison: my fine-tuned stage 2 against a general vision API on the same crops, same prompt steelmanned, model ID and date pinned, including the cases where the API wins.

    Success looks like

    • At least one four-leaf clover found by the model before I found it by eye, or an honest write-up of why not.
    • Stage-2 precision/recall reported on 100% real photos.
    • The comparison against a general vision API published with the baseline's wins included.

Facts

  • Four-leaf clovers are commonly cited as about 1 in 5,000; a 2017 crowd survey put it near 1 in 5,076.