{"slug": "leaf-gill-an-offline-plant-and-mushroom-identifier-that-knows-when-it-s-guessing", "title": "Leaf & Gill: an offline plant and mushroom identifier that knows when it's guessing", "summary": "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.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass](https://dev.to/challenges/hacktoberfest-week1-2026-10-05)*\n\nThe 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.\n\nSo I built one that doesn't.\n\n**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 downloading offline maps. After that it works in airplane mode, at the top of a mountain or at the bottom of a forest.\n\nYou 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.\n\nFor every photo you get:\n\nIt 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](https://pubmed.ncbi.nlm.nih.gov/36794335/), the best identification app got the species right only 49% of the time. Safety shaped every design decision below.\n\n**Try it:** [https://mohamedaminehamdi.github.io/leaf-and-gill/](https://mohamedaminehamdi.github.io/leaf-and-gill/)\n\nOn 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.\n\nNo 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.\n\n| Deadly look-alikes | Honest uncertainty | \n|---|---|\n\nOn 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.\n\n**Identify wild plants, trees and mushrooms offline, anywhere in the world.**\nAn open-source AI model runs inside your phone's browser. No signal, no account, no install, no photo ever uploaded.\n\n**Try it:** [https://mohamedaminehamdi.github.io/leaf-and-gill/](https://mohamedaminehamdi.github.io/leaf-and-gill/)\nOn an iPhone, open it in Safari and choose **Share → Add to Home Screen**\nThe model is downloaded once (~600 MB, like offline maps) and works in airplane mode after that.\n\nPoint the camera at a leaf, a tree or a mushroom, then put the phone back in your pocket.\n\n[BioCLIP 2](https://huggingface.co/imageomics/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.\n\nThe 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.\n\nWriting 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:\n\nA 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:\n\nA raw model score is a bad guide: it says \"100%\" far too often. So I measured how often it's actually right.\n\n**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.\n\n|  | Plants | Fungi | \n|---|---|---|\n| Right species as the top match | 85.3% | 85.4% | \n| Right species in the top 5 | 97.4% | 96.6% | \n\n*Figures are for photos of species in the pack.*\n\nThen 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.\n\n**The meter.** [TabPFN](https://github.com/PriorLabs/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:\n\n**Results.** I tested it on 1,219 held-out photos:\n\n|  | Raw model score | TabPFN trust meter | \n|---|---|---|\n| Separates right from wrong (AUROC) | 0.817 | **0.843** | \n| Calibration (Brier, lower is better) | 0.167 | **0.148** | \n| Answers it dares to call \"Very likely\" | 1.1% | **23.6%** | \n\n**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.\n\n**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.\n\nBecause the trail has no signal, and closed apps need one.\n\nAn 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.\n\nI 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.\n\n*Not a substitute for an expert. Never eat anything based on an app. Go outside anyway.* 🌿🍄", "url": "https://wpnews.pro/news/leaf-gill-an-offline-plant-and-mushroom-identifier-that-knows-when-it-s-guessing", "canonical_source": "https://dev.to/mohamedaminehamdi/leaf-gill-an-offline-plant-and-mushroom-identifier-that-knows-when-its-guessing-ea3", "published_at": "2026-10-11 22:26:33+00:00", "updated_at": "2026-10-11 22:33:34.038386+00:00", "lang": "en", "topics": ["artificial-intelligence", "computer-vision", "ai-tools", "ai-products"], "entities": ["Leaf & Gill", "BioCLIP 2", "Imageomics Institute", "iNaturalist", "Hacktoberfest", "Mohamed Amine Hamdi"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/leaf-gill-an-offline-plant-and-mushroom-identifier-that-knows-when-it-s-guessing", "markdown": "https://wpnews.pro/news/leaf-gill-an-offline-plant-and-mushroom-identifier-that-knows-when-it-s-guessing.md", "text": "https://wpnews.pro/news/leaf-gill-an-offline-plant-and-mushroom-identifier-that-knows-when-it-s-guessing.txt", "jsonld": "https://wpnews.pro/news/leaf-gill-an-offline-plant-and-mushroom-identifier-that-knows-when-it-s-guessing.jsonld"}}