cd /news/artificial-intelligence/leaf-gill-an-offline-plant-and-mushr… · home › topics › artificial-intelligence › article
[ARTICLE · art-149317] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Leaf & Gill: an offline plant and mushroom identifier that knows when it's guessing

A developer built Leaf & Gill, an offline plant, tree and mushroom identifier that runs the open-source BioCLIP 2 model entirely in the phone's browser with no server uploads. The app downloads a 609 MB model once and then works in airplane mode, and the developer measured it against 3,000 iNaturalist research-grade photos from after June 2025, finding the correct species as the top match 85.3% of the time for plants and 85.4% for fungi, rising to 97.4% and 96.6% in the top five. Citing a 2023 Australian study in which the best identification app got mushroom species right only 49% of the time, the app never declares anything edible and surfaces a trust meter when it is unsure.

by read5 min views3 publishedOct 11, 2026

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass The best places to hike have one thing in common: no signal. That's exactly where you find the plant you want to name, or the mushroom you really shouldn't touch. It's also exactly where every identification app stops working, because they all send your photo to a server.

So I built one that doesn't.

Leaf & Gill identifies wild plants, trees and mushrooms offline, anywhere in the world. You open it once with Wi-Fi, and it saves an open-source AI model to your phone, like down offline maps. After that it works in airplane mode, at the top of a mountain or at the bottom of a forest.

You snap a photo, glance at the answer and put the phone back in your pocket. That's the whole interaction, so the screen is the shortest part of the walk.

For every photo you get: It never tells you something is edible. Every mushroom result says: never eat a wild mushroom based on an app. That isn't just a disclaimer. In a 2023 study of mushroom-poisoning cases in Australia, the best identification app got the species right only 49% of the time. Safety shaped every design decision below.

Try it: https://mohamedaminehamdi.github.io/leaf-and-gill/ On an iPhone, open it in Safari, choose Share → Add to Home Screen and open it from the icon. The first launch downloads the model (609 MB). After that, turn on airplane mode and it still works.

No plant photo handy? Once the model has loaded, tap one of the example photos (fly agaric, poison hemlock, chanterelle, dandelion) to see the warnings and the trust meter in action.

| Deadly look-alikes | Honest uncertainty |

|---|---| On the right, the app isn't fully sure which chanterelle this is. It says so, and it warns about the toxic jack-o'-lantern mushroom that chanterelle hunters confuse it with.

Identify wild plants, trees and mushrooms offline, anywhere in the world. An open-source AI model runs inside your phone's browser. No signal, no account, no install, no photo ever uploaded.

Try it: https://mohamedaminehamdi.github.io/leaf-and-gill/ On an iPhone, open it in Safari and choose Share → Add to Home Screen The model is downloaded once (~600 MB, like offline maps) and works in airplane mode after that.

Point the camera at a leaf, a tree or a mushroom, then put the phone back in your pocket.

BioCLIP 2 is an open model from the Imageomics Institute, released under the MIT licence. It was trained on 200 million biology images across the tree of life. It works like CLIP: it turns a photo and a species name into vectors, and a photo lands closest to its own name. That means I don't need a classifier for a fixed list. I can match photos against any list of names.

The app itself is one HTML file and one JavaScript module. There's no framework and no build step. A service worker caches the app, and the model sits in the browser's Cache Storage.

Writing field-guide cards with an LLM was tempting. For a tool that talks about poisonous mushrooms, it was also the wrong call. So nothing in the app is generated:

A small test suite runs in CI and fails the build if edible, tasty or delicious appears anywhere in the shipped data. It caught three things I'd never have spotted by eye:

A raw model score is a bad guide: it says "100%" far too often. So I measured how often it's actually right.

The test set. I collected 3,000 iNaturalist research-grade photos observed after June 2025, newer than BioCLIP 2's training data, so it can't have memorised them.

Plants Fungi
Right species as the top match 85.3% 85.4%
Right species in the top 5 97.4% 96.6%

Figures are for photos of species in the pack.

Then the real-world catch: 22% of the photos were species outside the pack. On a real trail you'll photograph things the app doesn't know, and a good app should say "not sure" when that happens.

The meter. TabPFN is an open tabular foundation model. It learns from a small table in one pass, with no training run. I gave it four numbers per photo, labelled with whether the top match was right:

Results. I tested it on 1,219 held-out photos:

Raw model score TabPFN trust meter
Separates right from wrong (AUROC) 0.817 0.843
Calibration (Brier, lower is better) 0.167 0.148
Answers it dares to call "Very likely" 1.1% 23.6%

The miss. I aimed for top-band answers to be right at least 95% of the time. On held-out photos it reached 92.4%. So the top band is labelled "Very likely", not "Confident", and every result shows the calibrated "% likely right" next to it.

On the phone. TabPFN can't run in a phone browser, so I evaluate it on a 21×21×21 grid for each kingdom and ship the predictions as JSON. The phone interpolates between grid points, offline.

Because the trail has no signal, and closed apps need one.

An open model from a biology institute, open species data from GBIF, and an open tabular model from Prior Labs, all running offline in a browser on a hiking trail. That combination isn't available from any closed API.

I built this with Claude Code as my pair programmer, from the first research question ("can a 609 MB biology model run in iPhone Safari?") to the evaluation and the safety tests.

Not a substitute for an expert. Never eat anything based on an app. Go outside anyway. 🌿🍄

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @leaf & gill 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/leaf-gill-an-offline…] indexed:0 read:5min 2026-10-11 · —