
The Goal
A vision model that runs on a HUSKYLENS 2 (Kendryte K230, 6 TOPS AI accelerator) and classifies species into safety tiers:
- DEADLY — do not touch, do not eat
- TOXIC — causes serious harm
- EDIBLE — safe to eat, confirm ID first
- MEDICINAL — documented medicinal use
- INFO — identification and environmental context
The model has to be small enough for edge deployment, fast enough for real-time use, and — critically — it has to be right about the dangerous stuff.
The Pipeline
1. Data Collection
I wrote a Python scraper that pulls research-grade, expert-verified observations from the iNaturalist API. Research-grade means community consensus on identification — these aren't random smartphone photos with guessed labels.
50 classes across 5 categories:
- Mushrooms (18): 4 deadly, 1 toxic, 7 edible, 6 medicinal
- Plants (18): 2 deadly, 3 toxic, 4 edible, 1 edible cooked, 8 medicinal (added in v1 final — renamed from 13 to 18)
- Leaves (5): oak, maple, birch, fern, pine
- Rocks (6): granite, limestone, sandstone, obsidian, quartz, basalt
Total: 17,700 images. Dangerous species are intentionally oversampled — death cap and destroying angel get 600 images each while safe species get 300. When someone's life is on the line, false negatives on deadly species are unacceptable.
2. Dataset Preparation
A preparation script validates every image (corrupt file detection, minimum size check), splits into train/val/test (roughly 84/16 split plus held-out test), and generates a safety-tagged class map. Every class gets a safety label baked into the metadata so the device firmware can display appropriate warnings.
3. Training
YOLOv8n-cls (nano classification) on an NVIDIA RTX 2070 SUPER. 1.5 million parameters, 3.4 GFLOPs.
- 224×224 input
- Batch size 32
- 100 max epochs, patience 20
- Mixed precision (AMP)
- RandAugment, horizontal/vertical flips, HSV jitter, rotation
Training stopped early at epoch 85 (best model at epoch 65). Total training time: 51 minutes.
4. Results
| Score |
|---|
| 88.4>#/td### |
| 98.4>#/td### |
| 3.1 MB |
| 5.7 MB |
| 0.2ms per image |
88.4% top-1 means the model picks the correct species 88% of the time across all test images — including bad angles, poor lighting, and visually similar species. 98.4% top-5 means the correct answer is almost always in the model's top candidates.
More importantly: on clean, well-lit images of distinctive species, confidence scores hit 95-99%. A photo of a destroying angel / death cap came back at 100% confidence. A baby bella mushroom (not in the training set) came back at 6% — the model knows when it doesn't know.
Live Demo
Exported to ONNX and ran live inference through a USB webcam using OpenCV. Point the camera at a photo on my phone, get real-time classification with confidence scores. Chanterelle: 99%. Death cap: 99%. Unknown grocery store mushroom: low confidence, no false ID. Exactly the behavior you want from a safety-critical system.
Hardware Target
The final model deploys to a HUSKYLENS 2 AI camera (Kendryte K230, 6 TOPS, 1GB RAM). A custom PCB designed by my collaborator Yasir Ahmad. The MCU board runs dual RP2350 processors handling sensor fusion, UI, and audio while the HUSKYLENS handles all vision processing. Communication over UART/I2C.
The nano model at 3.1MB with 0.2ms inference is absurdly comfortable on this hardware. Which is good, because V2 is going to need the headroom.
What's Next: V2
V2 expands from 50 to ~200 classes:
- Berries (22 classes — deadly and edible)
- Insects & arachnids (37 classes — venomous spiders, stinging caterpillars, edible insects)
- Snakes (10 classes — venomous + harmless lookalikes)
- Animal tracks (17 classes — predator awareness, wildlife)
- Trees by bark (12 classes — year-round ID)
- Lichen (8 classes — survival food, air quality indicators)
- Edible nuts (8 classes)
- Marine life (20 classes — fish, crustaceans, shellfish)
- Additional mushrooms (12 classes — more deadly lookalikes, regional edibles)
The V2 dataset downloader is running right now on a separate machine. 57,000+ images from iNaturalist, targeting a YOLOv8s-cls (small) model for the larger class count.
I've also compiled a full species database document with safety classifications, identification notes, lookalike warnings, and survival context for all 200 classes. Every entry leads with what can hurt you, then follows with utility.
The Point
ATLAS isn't a nature app. It's a field instrument. The difference is that a nature app tells you what something is. ATLAS tells you whether it's going to kill you, and it does it on-device with no cell service required.
Apollo Timbers
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.