DEV Community

Sumit Das
Sumit Das

Posted on

PlantDex: A Pokédex for Real Plants — Built with Local On-Device AI

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass


What I Built

PlantDex is an open-source, mobile-first web app that turns any nature walk into an interactive botanical field quest — a Pokédex for the real world.

Point your phone's camera at any wild plant, tree, flower, or weed:

  1. 🌿 The app identifies the specimen using a quantized on-device neural network running entirely on the server's CPU — no cloud calls, no third-party AI APIs.
  2. 📋 Assigns an official Dex number — e.g. #0001 Betula lenta (Sweet Birch) — and adds it to your personal botanical Pokédex.
  3. 📚 Fetches peer-reviewed botanical facts — taxonomy, family, habitat, medicinal/ecological notes — pulled from Wikipedia REST API and GBIF, cached in a local SQLite database.
  4. 📈 Tracks your field progress with discovery statistics, completion percentages, and locked silhouette teasers for unidentified species.

The app is designed specifically for the Touch Grass challenge theme: it actively rewards going outside and discovering the living world around you. The more you explore, the more your Dex fills up.

Who Is It For?

  • Hikers, trail runners, and urban explorers who want to put a name to the plants they pass every day.
  • Citizen science enthusiasts contributing local observations to botanical knowledge.
  • Families and teachers making nature walks educational and gamified.
  • Anyone who wants to spend more time outside and less time staring at a screen.

Code

🌿 PlantDex — Pokédex for the Living World

Hacktoberfest 2026 Python 3.10+ Flask License: MIT Hosting: Render

"Step outside, point your lens at any wild leaf or bloom, and register it into your personal botanical Pokédex."

Built for the Hacktoberfest 2026 Open-Source AI Challenge, Theme: Touch Grass.


📖 Table of Contents

  1. Overview & Project Goal
  2. Why Open & Local AI Matters
  3. System Architecture & Data Flow
  4. Identification Engine & Confidence Logic
  5. Unknown Plants, Custom Naming & Offline Sync
  6. Local Setup & Running Locally
  7. Render Deployment Guide (512 MB RAM Optimization)
  8. Ephemeral vs Persistent Storage on Render
  9. CLI Management & Database Backup
  10. 10-Plant Benchmark & Honest Evaluation Report
  11. Known Limitations
  12. Draft for DEV Challenge Submission Post
  13. Open-Source Credits & Data Licenses

🌟 Overview & Project Goal

PlantDex is an open-source web application designed to motivate people to disconnect from screens, get outside, and explore biodiversity in their neighborhoods, urban parks, and wilderness trails.

Inspired by the tactile joy…

Repository: https://github.com/codebysumit/plantdex


How I Built It

The AI Core: Google AIY Plants Classifier V1 (TFLite)

The identification engine is built around Google's AIY Plants Classifier V1 — a quantized TensorFlow Lite model (plants_v1.tflite, ~3.7 MB) trained on over 2,100 plant species using verified binomial taxonomic nomenclature from iNaturalist and GBIF. It runs entirely in CPU memory with no GPU required.

Model: Google AIY Plants V1 (Apache 2.0)
Size: ~3.7 MB (quantized INT8)
Classes: 2,102 botanical species
Runtime: tflite-runtime / ai-edge-litert
Memory footprint: < 90 MB on server
Enter fullscreen mode Exit fullscreen mode

3-View Multi-Crop Inference

To squeeze maximum accuracy out of hand-held phone photos, every capture is processed with three inference passes:

  1. Full Frame — downscaled to 224×224 RGB.
  2. Center Square Crop — extracted from the middle region of the image.
  3. Mirrored Center Crop — horizontally flipped center crop.

The three probability vectors are averaged, the artificial background class is zeroed out, and the final softmax produces the confidence score.

Confidence Decision Tiers

Tier Threshold Outcome
🟢 CAUGHT ≥ 50% Auto-saved to Dex with catch animation
🟡 MAYBE 25% – 50% Shows Top-3 candidates; user confirms
🔴 NOT SURE < 25% "Do you know this plant?" — custom entry or Unknown N

Tech Stack

  • Backend: Python 3.10 + Flask 3.0 + SQLite (zero heavy frameworks)
  • AI Runtime: tflite-runtime (Linux) / ai-edge-litert (Windows/macOS)
  • Frontend: Mobile-first PWA with vanilla JS, camera capture API, canvas downsampling
  • Background Jobs: Thread-safe sync_worker.py fetches Wikipedia/GBIF details asynchronously with exponential backoff
  • Hosting: Optimized for Render Free Tier (1 CPU core, 512 MB RAM, 1 Gunicorn worker, 4 threads)

Privacy by Design

EXIF metadata and GPS coordinates are stripped from every uploaded photo using Pillow before anything is stored. No location data ever leaves the server. Photos are only sent to Gemini Vision for "double-check" analysis if the user explicitly clicks the optional button.


Why Does Open Innovation Matter?

The standard playbook for an AI-powered app in 2026 is: wrap an API, call GPT-4o or Claude, ship it. That approach fails completely for a plant identification app meant to be used outside — and here's why:

1. No Signal in the Wild

When you're hiking through a forest ravine, you don't have 5G. A cloud-dependent AI is useless. PlantDex's local TFLite model runs entirely on the server's CPU with the SQLite botanical cache. A catch still registers when the network drops.

2. Frugality = Accessibility

The entire inference stack runs on less than 90 MB of RAM on a single-core CPU. This means:

  • Anyone can host it on a free Render instance — zero cloud AI costs.
  • Community botanical clubs, schools, and individuals can self-host their own Pokédex server.
  • The marginal cost per plant identification is exactly $0.

3. Privacy as a Feature, Not an Afterthought

A closed commercial API would receive your photos, GPS coordinates, and timestamp data. For an app that tracks where you walk and what you observe in your neighborhood, that's a serious privacy concern. The open-source stack lets us strip all metadata before it even hits our own database, let alone any third-party server.

4. Open Science and Reproducible Taxonomy

The AIY Plants model labels correspond directly to GBIF-verified binomial nomenclature — the same scientific naming standard used in peer-reviewed literature. Every identification is traceable and auditable. There are no black-box API responses that can change without notice.

5. The Graceful Unknown

Closed AI systems often just return an error or a wrong answer with false confidence. PlantDex's three-tier confidence system means the app always does something useful, even when the model isn't sure — routing you through a user-naming workflow that enriches the community database for every future user.

Open innovation didn't just make this possible — it made it honest.


Prize Categories

  • 🌿 Hacktoberfest Open-Source AI Challenge — Touch Grass (primary)
  • 🤖 Open-Source AI / Local Inference track — 100% open-weight model, no closed APIs required for core functionality
  • 🔒 Privacy-respecting AI — EXIF/GPS stripping, no third-party data leakage

Top comments (0)